SlideShare a Scribd company logo
MICROSERVICES
ARCHITECTURE
Abdelghani Azri
26/05/2016 Sqli Group 1
ABOUT ME
• Senior Software Developer at Sqli Group Rabat Morocco
• JAVA / OCEJWCD & HYBRIS certified
• I worked in many E-Commerce projects based on SAP
Hybris Platform
• @abdelghaniazri
26/05/2016 Sqli Group 2
SUMMARY
• INTRODCUTION & HISTORY
• WHAT IS MICROSERVICES ARCHITECTURE?
• CHARACTERISTICS OF MICROSERVICES
• BENEFITS OF MICROSERVICES
• REQUIREMENTS FOR MICROSERVICES
• WHO HAS USE THEM ?
• MICROSERVICES PATTERNS
• FRAMEWORKS FOR MICROSERVICES
• BUILDING MICROSERVICES ARCHITECTURE
• DEMO
• REFERENCES
26/05/2016 Sqli Group 3
INTRODUCTION
Application
Monolithical Microservices
26/05/2016 Sqli Group 4
MONOLITHICAL VS MICROSERVICES
26/05/2016 Sqli Group 5
Source: Martin Fowler blog
MONOLITHICALAPPLICATIONS
• The term Monolothic Used by Unix community and
appears first time in The Art of Unix Programming
• It describe a big application
• Single-tiered software application in which the user
interface and data access code are combined into a
single program from a single platform. (Wikipedia)
26/05/2016 Sqli Group 6
MONOLITHICALAPPROACH PROS
• Single codebase
• Easy to develop/debug/deploy
• Good IDE support
• Easy to scale
• A Central Ops team can efficiently handle
26/05/2016 Sqli Group 7
MONOLITHICALAPPROACH
DRAWBACKS
• Large Codebase
• Many Components, no clear ownership
• Long deployment cycles
• As codebase increases …
• Tends to increase “tight coupling” between components
• All components have to be coded in the same language
26/05/2016 Sqli Group 8
MONOLITHICALAPPROACH
EVOLUTIONS
User Accounts
Shopping Cart
Product Catalog
Customer Service
26/05/2016 Sqli Group 9
Source: http://fr.slideshare.net/stonse/microservices-at-netflix
HISTORY
• The term « microservice » appeared firstly in 2011 in
software architecture workshop near Venice
• In Mai 2012: “Java, the Unix Way” at 33rd degree by
James Lewis
• September 2012: “μService Architecture“ at Baruco by
Fred George
• Adrian Cockroft at Netflix« FINE GRAINED SERVICES »
Source: http://martinfowler.com/articles/microservices.html#footnote-etymology
26/05/2016 Sqli Group 10
DEFINITION
• No concret definition.
• Microservices is not SOA
• Microservices is an architecture style
• Large complex software applications are composed of
[1..n] Small services
• Each of them complets one task
• Each task represent a small business capability
• Bounded context
26/05/2016 Sqli Group 11
MICROSERVICES APPLICATION
Source: IBM Redbooks Microservices from Theory to Practice
26/05/2016 Sqli Group 12
COMPARISON
MONOLITHICAL VS MICROSERVICES
Category Monolithic architecture Microservices architecture
Code Single code base Multiple code base.
Each microservice has its
own code base
Understandability Often confusing and hard to
understand
Much better readability
And easier to maintain
Deployment Complex deployments with
maintenance windows and
scheduled downtimes.
Simple deployment as each
microservice can be
deployed individually, with
minimal if not zero downtime.
Language Typically entirely developed in
one programming language.
Each microservice can be
developed in a different
programming language.
Scaling Requires you to scale the
entire application even though
bottlenecks are localized.
Enables you to scale
bottle-necked services
without scaling the entire
application.
26/05/2016 Sqli Group 13
OPERATIONAL REQUIREMENTS FOR
MICROSERVICES
• DOMAIN DRIVEN DESIGN
• Eric Evans’ DDD approach
• Anemic domain model = database tables mapped to objects. No
behavior
• Rich domain model = a collection of objects that expose behavior
26/05/2016 Sqli Group 14
OPERATIONAL REQUIREMENTS FOR
MICROSERVICES
• SINGLE RESPONSIBILITY PRINCIPLE
• Each service is responsible for a single part of the functionnality
and does it well
26/05/2016 Sqli Group 15
OPERATIONAL REQUIREMENTS FOR
MICROSERVICES
• EXPLICITY PUBLISHED INTERFACE
• A producer service publishes an interface that is used by a
consumer service
26/05/2016 Sqli Group 16
OPERATIONAL REQUIREMENTS FOR
MICROSERVICES
• INDEPENDENT DURS
• DEPLOY,UPDATE,REPLACE,SCALE
• Each service can be independently deployed, updated, replaced
and scaled
26/05/2016 Sqli Group 17
OPERATIONAL REQUIREMENTS FOR
MICROSERVICES
• LIGHT WEIGHT COMMUNICATION
• REST over HTTP
• STOMP over WebSocket
• Other similar lightweight are used for communication between
services
26/05/2016 Sqli Group 18
OPERATIONAL REQUIREMENTS FOR
MICROSERVICES
• DECENTRALIZED DATA MANAGEMENT
• PRODUCTS NOT PROJECTS
• INFRASTRUCTURE AUTOMATION
26/05/2016 Sqli Group 19
BENEFITS OF MICROSERVICES
• INDEPENDENT SCALING
• Each microservice can scale independently
• INDEPENDENT UPGRADES
• Each microservice can deployed independently
• Teams are independent
• EASY MAINTENANCE
• Each microservice does one feature : code more readable
• POTENTIAL HETEROGENEITY AND POLYGLOTISM
• Teams may have # platform, language
• FAILURE AND RESOURCE ISOLATION
• If one service crash, it will not affect the rest of application
• IMPROVED COMMUNICATION ACROSS TEAMS
• Membres of domain work in single team
26/05/2016 Sqli Group 20
OPERATIONAL REQUIREMENTS FOR
MICROSERVICES
• SERVICE REPLICATION
• SERVICE DISCOVERY
• SERVICE MONITORING
• RESILIENCY
• DEVOPS
26/05/2016 Sqli Group 21
MICROSERVICES PATTERNS
• Aggregator:
Results from multiple microservices are aggregated into
one composite microservice.
26/05/2016 Sqli Group 22
Source dzone.com
MICROSERVICES PATTERNS
• Proxy:
The Proxy microservice design pattern is a variation of the
Aggregator. In this case, aggregation does not need to
happen client-side. Rather, a different microservice may be
invoked as required by the business logic.
26/05/2016 Sqli Group 23
MICROSERVICES PATTERNS
• Chained:
single consolidated response to a request
26/05/2016 Sqli Group 24
MICROSERVICES PATTERNS
• Branch:
Service A either a web page or a composite microservice
may invoke two different chains concurrently
26/05/2016 Sqli Group 25
MICROSERVICES PATTERNS
• Shared Resources:
• the service is full-stack and has control of all the
components UI, middleware, persistence, transactions.
This allows the service to be polyglot, so the right tool can
be used for the right job
26/05/2016 Sqli Group 26
MICROSERVICES PATTERNS
• Asynch Messaging:
Since Rest is synchronous, Some services elect to use
message queues instead of REST: RabbitMQ, ActiveMQ…
26/05/2016 Sqli Group 27
WHO HAS USE THEM ?
• Great success in some big systems
• ThoughtWorks
• Netflix
• Amazon
• REA Group
• Soundcloud
• eBay
• Google
• …
26/05/2016 Sqli Group 28
JAVA FRAMEWORKS FOR
MICROSERVICES
• Spring Boot
• Dropwizard
• Jersey
• Ninja Web Framework
• Play Framework
• RestExpress
• Restlet
• Restx
• Spark Framework
• …
26/05/2016 Sqli Group 29
OTHER FRAMEWORKS
• Flask (python)
• Sinatra (Ruby)
• Vert.x (Polyglotte)
• Service Fabric (DOT NET)
26/05/2016 Sqli Group 30
BUILDING MICROSERVICES
ARCHITECTURE
• Conway’s law
• Invented by the computer programmer M. Conway's in 1967
• organizations which design systems ... are constrained to produce
designs which are copies of the communication structures of these
organizations
26/05/2016 Sqli Group 31
BUILDING MICROSERVICES
ARCHITECTURE
• Dependency services
Your
App/Service
Service A
Service B
Service C
Service X
Service Y
26/05/2016 Sqli Group 32
BUILDING MICROSERVICES
ARCHITECTURE
• Server caching for hight availability
Your
App/Service
Service X
Service Y
Service Z
Cache
ClusterCache
Cluster
26/05/2016 Sqli Group 33
BUILDING MICROSERVICES
ARCHITECTURE
• Homogeneity in a Polyglot Ecosystem
26/05/2016 Sqli Group 34
Source: http://fr.slideshare.net/stonse/microservices-at-netflix
BUILDING MICROSERVICES
ARCHITECTURE
Account
Service
Product
Service
Cart Service Order Service
Account DB
Product DB Cart DB
Order DB
Online Shopping Service
26/05/2016 Sqli Group 35
Online shop
Order DBAccount DB
Example from microservices with spring spring.io
BUILDING MICROSERVICES
ARCHITECTURE
26/05/2016 Sqli Group 36
Online shop
BUILDING MICROSERVICES
ARCHITECTURE
• Service Registration
26/05/2016 Sqli Group 37
BUILDING MICROSERVICES
ARCHITECTURE
• Add spring boot to pom
26/05/2016 Sqli Group 38
BUILDING MICROSERVICES
ARCHITECTURE
• Add Spring Cloud to pom
26/05/2016 Sqli Group 39
BUILDING MICROSERVICES
ARCHITECTURE
• Registration configuration
26/05/2016 Sqli Group 40
BUILDING MICROSERVICES
ARCHITECTURE
• Creating a Microservice: Account-Service
26/05/2016 Sqli Group 41
BUILDING MICROSERVICES
ARCHITECTURE
• Creating a Microservice: Account-Service
26/05/2016 Sqli Group 42
BUILD MICROSERVICES
ARCHITECTURE
• Encapsulating WebAccountService Access
26/05/2016 Sqli Group 43
DEMO
Demo Spring Boot
26/05/2016 Sqli Group 44
SUMMARY
• Microservices: functional decomposition of systems into
manageable and independently deployable services
• Microservices is not SOA
• Microservices can be seen as “SOA – the good parts”
• Will microservices help me ??
• Domain modeling, boundaries, runtime dependencies, loose coupling
& culture/organizational structure
• Microservice architectures means
• Independence in code, technology, scaling, evolution
• Using battle-tested infrastructure (HTTP, JSON, REST)
26/05/2016 Sqli Group 45
REFERENCES
• Sites:
• http://martinfowler.com/articles/microservices.html
• http://2012.33degree.org/talk/show/67
• http://www.melconway.com/Home/Committees_Paper.html
• http://martinfowler.com/microservices/
• http://martinfowler.com/articles/microservice-testing/#testing-
component-introduction
• http://blog.inovia-conseil.fr/?p=155
• http://blog.xebia.fr/2015/03/02/microservices-les-concepts/
• https://spring.io/blog/2015/07/14/microservices-with-spring
• Ebooks:
26/05/2016 Sqli Group 46
QUESTIONS
26/05/2016 Sqli Group 47

More Related Content

PPTX
Microservices Architecture
PPTX
Introduction To Microservices
PDF
Microservice Architecture
PPTX
Microservices
PPTX
Introduction to Microservices
PPTX
Introduction to microservices
PPTX
Microservice vs. Monolithic Architecture
PPTX
Introduction to Microservices
Microservices Architecture
Introduction To Microservices
Microservice Architecture
Microservices
Introduction to Microservices
Introduction to microservices
Microservice vs. Monolithic Architecture
Introduction to Microservices

What's hot (20)

PDF
Why Microservice
PPTX
Monoliths and Microservices
PDF
Microservice Architecture
PPTX
Communication in a Microservice Architecture
PPTX
Introduction to microservices
PPT
Microservices
PPTX
Micro services Architecture
PPSX
Microservices Docker Kubernetes Istio Kanban DevOps SRE
PPTX
Api gateway in microservices
PDF
Terraform introduction
PPTX
Modern CI/CD Pipeline Using Azure DevOps
PPTX
PPTX
Service mesh
PPTX
Microservice architecture design principles
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
PDF
Design patterns for microservice architecture
PPTX
Pub/Sub Messaging
PPSX
Microservices, Containers, Kubernetes, Kafka, Kanban
PPTX
Introduction to Azure DevOps
PDF
Testing Microservices
Why Microservice
Monoliths and Microservices
Microservice Architecture
Communication in a Microservice Architecture
Introduction to microservices
Microservices
Micro services Architecture
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Api gateway in microservices
Terraform introduction
Modern CI/CD Pipeline Using Azure DevOps
Service mesh
Microservice architecture design principles
Understanding MicroSERVICE Architecture with Java & Spring Boot
Design patterns for microservice architecture
Pub/Sub Messaging
Microservices, Containers, Kubernetes, Kafka, Kanban
Introduction to Azure DevOps
Testing Microservices
Ad

Viewers also liked (20)

PDF
DEVNET-1184 Microservices Patterns
PDF
Growing a microservices landscape (with smart use cases)
PPTX
CipherCloud Microservice Meetup - Managing Services in a Lean Startup
PDF
An introduction to smart use cases
PPTX
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015
PPTX
Microservices architecture
PDF
Formation autour de git et git lab
PDF
Integration Patterns for Microservices Architectures
PDF
Microservices deployment patterns
PPTX
Non functional requirements. do we really care…?
PDF
Developing polyglot persistence applications (SpringOne China 2012)
PDF
Self-contained Systems: A Different Approach to Microservices
PDF
Developing polyglot persistence applications (gluecon 2013)
PDF
How to Choose the Right Technology, Framework or Tool to Build Microservices
PDF
Building the Glue for Service Discovery & Load Balancing Microservices
PDF
Scalable Microservices at Netflix. Challenges and Tools of the Trade
PDF
Microservices and Self-contained System to Scale Agile
PDF
Microservices: Decomposing Applications for Deployability and Scalability (ja...
PDF
MicroService Architecture
PPTX
From SOA to MSA
DEVNET-1184 Microservices Patterns
Growing a microservices landscape (with smart use cases)
CipherCloud Microservice Meetup - Managing Services in a Lean Startup
An introduction to smart use cases
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015
Microservices architecture
Formation autour de git et git lab
Integration Patterns for Microservices Architectures
Microservices deployment patterns
Non functional requirements. do we really care…?
Developing polyglot persistence applications (SpringOne China 2012)
Self-contained Systems: A Different Approach to Microservices
Developing polyglot persistence applications (gluecon 2013)
How to Choose the Right Technology, Framework or Tool to Build Microservices
Building the Glue for Service Discovery & Load Balancing Microservices
Scalable Microservices at Netflix. Challenges and Tools of the Trade
Microservices and Self-contained System to Scale Agile
Microservices: Decomposing Applications for Deployability and Scalability (ja...
MicroService Architecture
From SOA to MSA
Ad

Similar to Microservices architecture (20)

PDF
Production-Ready_Microservices_excerpt.pdf
PDF
Microservices Interview Questions and Answers PDF By ScholarHat
PPTX
Micro service Arthicetcure
PPTX
Microservices and docker
PDF
Everything you want to know about microservices
PDF
Accion labs microservices white paper
PDF
Accion Labs microservices white paper
PDF
Accion Labs Microservices Whitepaper
PPTX
Micro Services
PPTX
MICROSERVICES ARCHITECTURE unit -2.pptx
PPTX
Microservices.pptx
PPTX
Microservice intro
PPTX
Microservices + Oracle: A Bright Future
PDF
Building Microservices Software practics
PPTX
Software Architectures, Week 3 - Microservice-based Architectures
PPTX
building microservices
PPTX
Microservice's in detailed
PPTX
An introduction to Microservices
PPTX
Microservices why?
PPTX
Microservices-101
Production-Ready_Microservices_excerpt.pdf
Microservices Interview Questions and Answers PDF By ScholarHat
Micro service Arthicetcure
Microservices and docker
Everything you want to know about microservices
Accion labs microservices white paper
Accion Labs microservices white paper
Accion Labs Microservices Whitepaper
Micro Services
MICROSERVICES ARCHITECTURE unit -2.pptx
Microservices.pptx
Microservice intro
Microservices + Oracle: A Bright Future
Building Microservices Software practics
Software Architectures, Week 3 - Microservice-based Architectures
building microservices
Microservice's in detailed
An introduction to Microservices
Microservices why?
Microservices-101

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
MYSQL Presentation for SQL database connectivity
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx
Advanced Soft Computing BINUS July 2025.pdf
cuic standard and advanced reporting.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology

Microservices architecture