2. Pre-Microservices era
SOA/ESB with APIs
Consumers
ESB
System
Service 1 Service 2 Service 3 Service 4 Service 5
API Management
Application server
3. • The foundation of MSA is about developing a
single application as a suite of fine-grained
and independent services running in its own
process, developed and deployed
independently.
Microservice Architecture
4. Evolution of Microservices
Microservices
Web Portal Mobile Apps Store Admin Web Storefrons Promotion Mgmt
API Management
Product Details Shopping Cart Order Mgt Payment Proc. Payment Proc. Customer Mgt.
Account Mgt Order Tracking Financial Mgt Fraud Detection Tax Mgt Inventory Mgt Allocation-Release
Self-Service Giftcards Promotions Pricing Subscription Credit service CRM Mgt Shipping
Data Warehouse Finance System Shipping Inventory Payment Gateway Cloud ServicesE.g. Salesforce, Paypal etc
5. • Common Misconceptions
– Lines of Code, Team size, 'Micro' is a bit misleading term
• Single Responsibility Principle(SRP)
– Having a limited and a focused business requirement.
• Scope
– Find the service boundaries and align them with the business
capabilities (aka DDD)
• Miniservices
– “A miniservice is a coarse-grained, independently deployable and
independently scalable application component.”
– “Innovation Insight for Miniservices”
Designing Microservices : Size, scope and
capabilities
6. • In Monolithic architecture:
– Function calls or language-level method calls
– SOA/web services : SOAP and WS* with HTTP, JMS etc.
– Web services with several dozens of operations and complex
message schemas
• In Microservices architecture:
– Simple and lightweight messaging mechanism.
Messaging in Microservices
8. • gRPC - https://grpc.io/
– IDL, Protobuf
– HTTP2
– Internal service calls
• Other RPC styles : Avro, Thrift
Messaging in Microservices
Synchronous Messaging
9. • Propagating changes across multiple microservices
– Single-receiver message-based communication
– Multiple-receivers message-based communication
• AMQP, Kafka, MQTT
Messaging in Microservices
Asynchronous Messaging
Source : https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/architect-microservice-container-applications/communication-in-microservice-architecture
10. • Asynchronous microservice integration -> enforces microservices
autonomy
Messaging in Microservices
Synchronous vs Asynchronous Messaging
Source : https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/architect-microservice-container-applications/communication-in-microservice-architecture
11. • Not all microservices are similar
– Business logic heavy, while some contain a lot of
interservice calls
– Synchronous vs async communication
– Too fine-grained to be exposed as a business functionality
– Some services are exposed as APIs
Do all Microservices similar?
12. Technologies for Building Composite/Integration
Microservices
• General Purpose Languages/Frameworks - Java,
Node.js, Groovy, e.g. SpringBoot, Dropwizard
• Bulky traditional ESB architecture -> Not fully
compatible with MSA principles
13. Technologies for Building Composite/Integration
Microservices
• General Purpose Languages/Frameworks - Java,
Node.js, Groovy, e.g. SpringBoot, Dropwizard
• Bulky traditional ESB architecture -> Not fully
compatible with MSA principles
15. Organizing Microservices
Microservice Types with Different Granularities
Consumer 1
API Service 1 API Service 2 API Service 3 API Service 4
Consumers
Consumer 2 Consumer 3
Service 6 Service 7 Service 8 Service 9
Service 1 Service 2 Service 3 Service 4 Service 5 Proprietary &
Legacy
Systems
Web API /
SaaS
API Services/
Edge Services
Composite Service/
Integration Services
Core Services/
Atomic Services
16. Organizing Microservices
Microservice Types with Different Granularities
Consumer 1
API Service P API Service Q API Service R API Service S
Consumers
Consumer 2 Consumer 3
μ Service A
μ Service B
μ Service F
μ Service G
Proprietary &
Legacy
Systems
Web API /
SaaS
API Services/
Edge Services
Composite Service/
Integration Services
Core Services/
Atomic Services
μ Service I
μ Service H
μ Service J
μ Service E
μ Service C
μ Service D
17. Microservices Security
Microservice security with OAuth2 and OpenID Connect.
Refer :
https://medium.facilelogin.com/securing-microservices-with-oauth-2-0-jwt-and-xacml-d03770a9a838
18. • Ability to deploy/un-deploy independently of other microservices.
• Must be able to scale at each microservices level.
• Building and deploying microservices quickly.
• Failure in one microservice must not affect any of the other services.
• Docker and Kubernetes.
Microservices Deployment
19. • Isolate the legacy and modern systems
by placing an anti-corruption layer
between them.
• Translates communications between the
two systems, allowing the legacy system
to remain unchanged while the modern
application can avoid compromising its
design and technological approach.
Bridging Microservices and Monolithic
systems
Anti-Corruption Layer pattern
Source:
https://docs.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer
20. • Incrementally replace specific pieces of
functionality with new applications and
services.
• Create a façade that intercepts requests
going to the backend legacy system.
Bridging Microservices and Monolithic
systems
Strangler Pattern
Source: https://docs.microsoft.com/en-us/azure/architecture/patterns/strangler
21. Data Management
Database per service
• Keep each microservice’s persistent data private to that
service and accessible only via its API.
• Create composite services to retrieve data from multiple
microservices.
• Eventual consistency between microservices through
event-driven communication and a publish-and-subscribe
system.
22. Governance
Decentralized Governance
• Decentralized governance of Service Design, Deployment
and Execution
– Give the teams the freedom to develop software
components using different stacks
– Define some ‘global standards’ that apply to the
methodology behind the software
23. Governance
Service Registry
• Central component which
supports:
– APIs to publish service
information (service endpoints,
contract, message models,
available service versions)
– APIs to query/discover service
information.
– Pull and push models to
retrieve service information
– Service ownership/consumers
source : https://www.nirmata.com/2014/08/13/getting-started-with-microservices-using-netflix-oss-docker/
24. Governance
Service Dependencies
• Managing/tracking and tracking
dependencies and associations
between services
• Derive service dependencies and
associations automatically, ability to
monitor/visualize them.
• Netflix Vizceral :
https://github.com/Netflix/vizceral
27. • “The most complex challenge in realizing
microservice architecture is not building the
services themselves, but the communication
between services.”
Service Mesh
Why Service Mesh?
28. Service Mesh
Why Service Mesh?
• With MSA, business logic
+ network communication
logic are dispersed across
independent services
Consumers
Microservice X Microservice Y Microservice Z
Microservice P Microservice Q Microservice R Microservice S
JAVA Node.js Python
33. • Use a pragmatic approach for adopting microservices architecture
for enterprises.
• Select the appropriate patterns and technologies based on your
business requirements.
Conclusion