SlideShare a Scribd company logo
©2017 GlobalLogic Inc.
Building microServices
Yuriy Chapran
©2017 GlobalLogic Inc.
Monolith
What are microservies ?
Design approaches used with microservices
Questions
01
02
03
04
©2017 GlobalLogic Inc.
How will you write service application ?
Section Title
− One or many processes ?
− Database or standalone file ?
− How will they all communicate ?
− How will you upgrade ?
− What if maximum amount of
users will triple in first week ?
− And grow ten times in a month ?
©2017 GlobalLogic Inc.
Monolith01
©2017 GlobalLogic Inc.
Characteristics and Benefits
Monolith
Section Title
− One build and deployment unit
− One code base
− One technology stack
−Simple mental model for
developers
−Simple scaling model for
operations - run multiple copies
behind a load balancer
©2017 GlobalLogic Inc.
Problems
Monolith
Section Title
− Huge and intimidating code base
for developers
−Development tools get
overburdened
−Scaling is limited
−Deployment frequency is limited
©2017 GlobalLogic Inc.
Characteristics and Benefits
Layered systems
Section Title
− A layered system decomposes a
monolith into layers, usually:
presentation, logic, data access
− At most one technology stack per
layer
− Simple mental model, simple
dependencies
− Simple deployment and scaling
model
©2017 GlobalLogic Inc.
Problems
Layered systems
Section Title
− Still huge codebases (one per
layer)
−Scaling works better, but still
limited
−Staff growth is limited: roughly
speaking, one team per layer
works well
©2017 GlobalLogic Inc.
What are microservies ?02
©2017 GlobalLogic Inc.
History
Section Title
−2011: First discussions using this term
at a software architecture workshop
near Venice
−May 2012: microservices settled as
the most appropriate term
−March 2012: “Java, the Unix Way” at
33rd degree by James Lewis
−September 2012: “µService
Architecture“ at Baruco by Fred George
−All along, Adrian Cockroft pioneered
this style at Netflix as “fine grained
SOA”
©2017 GlobalLogic Inc.
Section Title
What are Microservices ?
Microservices are small, autonomous services
that work together.
©2017 GlobalLogic Inc.
Small with a single responsibility
Section Title
−Each application does only one
thing
−Small enough to fit in your head
−Small enough that you can throw
them away
−Rewrite over Maintain
©2017 GlobalLogic Inc.
Autonomous
Section Title
−Embedded container or package (deb or
rpm etc.)
−Packaged as a single executable
−Along with their configuration files
−And unix standard rc.d scripts
−Installed separately
−Communicating with other services over
network, uses and exposes versioned API
−No DB or files shared between two
services
©2017 GlobalLogic Inc.
Located in different SVC roots
Section Title
−Each application is completely
separate
−Domains in different bounded
contexts should be distinct – and it's
ok to have duplication – Use
physical separation to enforce this
−There will be common code, but it
should be library and infrastructure
code – treat it as you would any
other open source library
©2017 GlobalLogic Inc.
Microservices provide benefits…
Tradeoffs
Section Title
− Strong Module Boundaries: Microservices
reinforce modular structure, which is
particularly important for larger teams.
− Independent Deployment: Simple services
are easier to deploy, and since they are
autonomous, are less likely to cause
system failures when they go wrong.
− Technology Diversity: With microservices
you can mix multiple languages,
development frameworks and data-storage
technologies.
…but come with costs
− Distribution: Distributed systems are
harder to program, since remote calls are
slow and are always at risk of failure.
− Eventual Consistency: Maintaining strong
consistency is extremely difficult for a
distributed system, which means everyone
has to manage eventual consistency.
− Operational Complexity: You need a
mature operations team to manage lots of
services, which are being redeployed
regularly.
https://martinfowler.com/articles/microservice-trade-offs.html
©2017 GlobalLogic Inc.
Service-oriented architecture (SOA)
Section Title
©2017 GlobalLogic Inc.
Design approaches used with microservices03
©2017 GlobalLogic Inc.
Business microservice
Section Title
− Design the application with a set
of modules where each is an
independent business function
with its own data, developed by a
separate team and deployed in a
separate process
©2017 GlobalLogic Inc.
API gateway
Section Title
− Exposes system API to outer
world - single entry point
− Has no business logic!
− Requests required information
from specific microservices
− Can perform protocol translation
− Must be highly available
©2017 GlobalLogic Inc.
Load balancers and Message queues
Section Title
−Decoupled and
asynchronous using of
messaging/events to remove
peer-to-peer dependencies
−Using Message Broker
pattern
−RabbitMQ, ZeroMQ
©2017 GlobalLogic Inc.
Results cache
Section Title
−Some services, when called
repeatedly, return the same
data every time and don’t
cause any side effects
−Results Cache can be as
simple as a Key-Value Store
−Set lifetime limit for cache,
from few seconds to few
hours
©2017 GlobalLogic Inc.
Circuit breaker
Section Title
©2017 GlobalLogic Inc.
Service registry + self registration + 3rd party
registration + configuration as a service
Section Title
−Knows about all running
services - physical IP
address and service type
−Gathers services health
information, like status,
uptime
−Can gather and aggregate
some microservices metrics
©2017 GlobalLogic Inc.
Favour choreography over orchestration
Section Title
©2017 GlobalLogic Inc.
Adapter microservice
Section Title
− Converts existing service’s non
microservice API to an API that
client microservice will expect.
− One of the first steps on
migrating from Monolith to
microServices
©2017 GlobalLogic Inc.
Log aggregator
Section Title
©2017 GlobalLogic Inc.
Correlation ID
Section Title
− How do you debug a complex call
graph when you do not know
where in the set of microservices
along that call graph the problem
may have been introduced?
−Simple identifier (usually just a
number)
−Passed into every service
request
−Is printed in the every log entry
related to the request
©2017 GlobalLogic Inc.
Health Check API
Section Title
− How to detect that a running
service instance is unable to
handle requests?
−An alert should be generated
when a service instance fails
−Requests should be routed to
working service instances
− A service has an health check
API endpoint that returns the
health of the service
©2017 GlobalLogic Inc.
Section Title
− You need to know when and where to
scale up or down
− Bould with Load balancer and Service
registry
− Aggregating monitors with alers
− Good, thought through metrics
− processing rate - amount of processed
req/sec
− amount of succeeded and failed requests
− length of requests queue - min, max, latest
− connections status
Application metrics
©2017 GlobalLogic Inc.
Infrastructure automation - CI/CD
Section Title
©2017 GlobalLogic Inc.
Still there are much more ...
Section Title
©2017 GlobalLogic Inc.
Summary04
©2017 GlobalLogic Inc.
Section Title
©2017 GlobalLogic Inc.
This is cool
Section Title
−We haven’t even talked about
−Versioning
−Integration
−Testing
−Deployment
−Security
−Anti-patterns
−Nanoservices
−Data driven migration
−...
©2017 GlobalLogic Inc.
Section Title
©2017 GlobalLogic Inc.
Literature
Section Title
©2017 GlobalLogic Inc.
Questions06
©2017 GlobalLogic Inc.
Contact Info
Thank You
©2017 GlobalLogic Inc.
Literature
Section Title
− http://2012.33degree.org/pdf/JamesLewisMicroServices.pdf
− http://www.braveterry.com/2014/04/10/presentation-service-architecture/
− http://www.pst.ifi.lmu.de/Lehre/wise-14-15/mse/microservice-architectures.pdf
− https://martinfowler.com/microservices/
− http://nealford.com/downloads/Building_Microservice_Architectures_Neal_Ford.pdf
− https://www.nginx.com/wp-content/uploads/2015/01/Building_Microservices_Nginx.pdf
− http://transform.ca.com/API-microservice-architecture-oreilly-book.html
− https://www.amazon.com/Microservices-Discover-Manage-Architecture/dp/151939733X
− https://www.openshift.com/promotions/microservices.html
− http://microservices.io
− http://www.vinaysahni.com/best-practices-for-building-a-microservice-architecture

More Related Content

PPTX
Micro services Architecture
PDF
The Complete Guide to Service Mesh
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
PPTX
Do You Need A Service Mesh?
PPTX
microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud...
PDF
Full lifecycle of a microservice
PDF
Microservice architecture
PDF
Istio: Using nginMesh as the service proxy
Micro services Architecture
The Complete Guide to Service Mesh
Understanding MicroSERVICE Architecture with Java & Spring Boot
Do You Need A Service Mesh?
microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud...
Full lifecycle of a microservice
Microservice architecture
Istio: Using nginMesh as the service proxy

What's hot (20)

PDF
Patterns of evolution from monolith to microservices
PPTX
What’s New with NGINX Controller Load Balancing Module 2.0?
PDF
Deploying NGINX in Cloud Native Kubernetes
PPTX
Microservices Architecture - Bangkok 2018
PPTX
Microservices in Action
PPTX
Blockchain on the oracle cloud, the next big thing
PDF
Comparison of Current Service Mesh Architectures
PDF
Microservices Architecture
PPTX
Kubernetes solutions
PDF
Orchestraing the Blockchain Using Containers
PDF
Why OpenDaylight
PDF
Deep-dive into APIs in a Microservice Architecture
PPTX
CWIN17 london becoming cloud native part 2 - guy martin docker
PPTX
Oracle Blockchain Cloud Service
PPTX
Connecting All Abstractions with Istio
PPTX
Making Microservices Smarter with Istio, Envoy and Pivotal Ingress Router
PDF
Developing applications with a microservice architecture (SVforum, microservi...
PDF
Innovation with Open Sources and App Modernization for Developers | Ian Y. Choi
PDF
Nats meetup sf 20150826
PPTX
Building a scalable microservice architecture with envoy, kubernetes and istio
Patterns of evolution from monolith to microservices
What’s New with NGINX Controller Load Balancing Module 2.0?
Deploying NGINX in Cloud Native Kubernetes
Microservices Architecture - Bangkok 2018
Microservices in Action
Blockchain on the oracle cloud, the next big thing
Comparison of Current Service Mesh Architectures
Microservices Architecture
Kubernetes solutions
Orchestraing the Blockchain Using Containers
Why OpenDaylight
Deep-dive into APIs in a Microservice Architecture
CWIN17 london becoming cloud native part 2 - guy martin docker
Oracle Blockchain Cloud Service
Connecting All Abstractions with Istio
Making Microservices Smarter with Istio, Envoy and Pivotal Ingress Router
Developing applications with a microservice architecture (SVforum, microservi...
Innovation with Open Sources and App Modernization for Developers | Ian Y. Choi
Nats meetup sf 20150826
Building a scalable microservice architecture with envoy, kubernetes and istio
Ad

Similar to Yuriy Chapran - Building microservices. (20)

PPTX
Microservices Architecture & Testing Strategies
PPTX
Micro Services Architecture
PPTX
Microservice intro
PDF
Introduction to Microservices Architecture - SECCOMP 2020
ODP
Monolithic to Microservices Architecture - STM 6
PPTX
Microservices why?
PPTX
An introduction to Microservices
PPTX
Micro service Arthicetcure
PDF
Microservice Architecture
PPTX
05 microservices microdeck
PPTX
Microservices architecture
PPTX
Microservice Architecture and Components
PDF
Building microservices on azure
PPTX
Concurrency at Scale: Evolution to Micro-Services
PDF
Microservices: cosa sono e quando non usarli
PDF
Design patterns for microservice architecture
PDF
Introduction to Microservices
PDF
A Gentle introduction to microservices
PDF
What are the Advantages and Disadvantages of Microservices?
PDF
Introduction to Microservices
Microservices Architecture & Testing Strategies
Micro Services Architecture
Microservice intro
Introduction to Microservices Architecture - SECCOMP 2020
Monolithic to Microservices Architecture - STM 6
Microservices why?
An introduction to Microservices
Micro service Arthicetcure
Microservice Architecture
05 microservices microdeck
Microservices architecture
Microservice Architecture and Components
Building microservices on azure
Concurrency at Scale: Evolution to Micro-Services
Microservices: cosa sono e quando non usarli
Design patterns for microservice architecture
Introduction to Microservices
A Gentle introduction to microservices
What are the Advantages and Disadvantages of Microservices?
Introduction to Microservices
Ad

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Mushroom cultivation and it's methods.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
Heart disease approach using modified random forest and particle swarm optimi...
TLE Review Electricity (Electricity).pptx
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Building Integrated photovoltaic BIPV_UPV.pdf
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Mushroom cultivation and it's methods.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars

Yuriy Chapran - Building microservices.

  • 1. ©2017 GlobalLogic Inc. Building microServices Yuriy Chapran
  • 2. ©2017 GlobalLogic Inc. Monolith What are microservies ? Design approaches used with microservices Questions 01 02 03 04
  • 3. ©2017 GlobalLogic Inc. How will you write service application ? Section Title − One or many processes ? − Database or standalone file ? − How will they all communicate ? − How will you upgrade ? − What if maximum amount of users will triple in first week ? − And grow ten times in a month ?
  • 5. ©2017 GlobalLogic Inc. Characteristics and Benefits Monolith Section Title − One build and deployment unit − One code base − One technology stack −Simple mental model for developers −Simple scaling model for operations - run multiple copies behind a load balancer
  • 6. ©2017 GlobalLogic Inc. Problems Monolith Section Title − Huge and intimidating code base for developers −Development tools get overburdened −Scaling is limited −Deployment frequency is limited
  • 7. ©2017 GlobalLogic Inc. Characteristics and Benefits Layered systems Section Title − A layered system decomposes a monolith into layers, usually: presentation, logic, data access − At most one technology stack per layer − Simple mental model, simple dependencies − Simple deployment and scaling model
  • 8. ©2017 GlobalLogic Inc. Problems Layered systems Section Title − Still huge codebases (one per layer) −Scaling works better, but still limited −Staff growth is limited: roughly speaking, one team per layer works well
  • 9. ©2017 GlobalLogic Inc. What are microservies ?02
  • 10. ©2017 GlobalLogic Inc. History Section Title −2011: First discussions using this term at a software architecture workshop near Venice −May 2012: microservices settled as the most appropriate term −March 2012: “Java, the Unix Way” at 33rd degree by James Lewis −September 2012: “µService Architecture“ at Baruco by Fred George −All along, Adrian Cockroft pioneered this style at Netflix as “fine grained SOA”
  • 11. ©2017 GlobalLogic Inc. Section Title What are Microservices ? Microservices are small, autonomous services that work together.
  • 12. ©2017 GlobalLogic Inc. Small with a single responsibility Section Title −Each application does only one thing −Small enough to fit in your head −Small enough that you can throw them away −Rewrite over Maintain
  • 13. ©2017 GlobalLogic Inc. Autonomous Section Title −Embedded container or package (deb or rpm etc.) −Packaged as a single executable −Along with their configuration files −And unix standard rc.d scripts −Installed separately −Communicating with other services over network, uses and exposes versioned API −No DB or files shared between two services
  • 14. ©2017 GlobalLogic Inc. Located in different SVC roots Section Title −Each application is completely separate −Domains in different bounded contexts should be distinct – and it's ok to have duplication – Use physical separation to enforce this −There will be common code, but it should be library and infrastructure code – treat it as you would any other open source library
  • 15. ©2017 GlobalLogic Inc. Microservices provide benefits… Tradeoffs Section Title − Strong Module Boundaries: Microservices reinforce modular structure, which is particularly important for larger teams. − Independent Deployment: Simple services are easier to deploy, and since they are autonomous, are less likely to cause system failures when they go wrong. − Technology Diversity: With microservices you can mix multiple languages, development frameworks and data-storage technologies. …but come with costs − Distribution: Distributed systems are harder to program, since remote calls are slow and are always at risk of failure. − Eventual Consistency: Maintaining strong consistency is extremely difficult for a distributed system, which means everyone has to manage eventual consistency. − Operational Complexity: You need a mature operations team to manage lots of services, which are being redeployed regularly. https://martinfowler.com/articles/microservice-trade-offs.html
  • 16. ©2017 GlobalLogic Inc. Service-oriented architecture (SOA) Section Title
  • 17. ©2017 GlobalLogic Inc. Design approaches used with microservices03
  • 18. ©2017 GlobalLogic Inc. Business microservice Section Title − Design the application with a set of modules where each is an independent business function with its own data, developed by a separate team and deployed in a separate process
  • 19. ©2017 GlobalLogic Inc. API gateway Section Title − Exposes system API to outer world - single entry point − Has no business logic! − Requests required information from specific microservices − Can perform protocol translation − Must be highly available
  • 20. ©2017 GlobalLogic Inc. Load balancers and Message queues Section Title −Decoupled and asynchronous using of messaging/events to remove peer-to-peer dependencies −Using Message Broker pattern −RabbitMQ, ZeroMQ
  • 21. ©2017 GlobalLogic Inc. Results cache Section Title −Some services, when called repeatedly, return the same data every time and don’t cause any side effects −Results Cache can be as simple as a Key-Value Store −Set lifetime limit for cache, from few seconds to few hours
  • 22. ©2017 GlobalLogic Inc. Circuit breaker Section Title
  • 23. ©2017 GlobalLogic Inc. Service registry + self registration + 3rd party registration + configuration as a service Section Title −Knows about all running services - physical IP address and service type −Gathers services health information, like status, uptime −Can gather and aggregate some microservices metrics
  • 24. ©2017 GlobalLogic Inc. Favour choreography over orchestration Section Title
  • 25. ©2017 GlobalLogic Inc. Adapter microservice Section Title − Converts existing service’s non microservice API to an API that client microservice will expect. − One of the first steps on migrating from Monolith to microServices
  • 26. ©2017 GlobalLogic Inc. Log aggregator Section Title
  • 27. ©2017 GlobalLogic Inc. Correlation ID Section Title − How do you debug a complex call graph when you do not know where in the set of microservices along that call graph the problem may have been introduced? −Simple identifier (usually just a number) −Passed into every service request −Is printed in the every log entry related to the request
  • 28. ©2017 GlobalLogic Inc. Health Check API Section Title − How to detect that a running service instance is unable to handle requests? −An alert should be generated when a service instance fails −Requests should be routed to working service instances − A service has an health check API endpoint that returns the health of the service
  • 29. ©2017 GlobalLogic Inc. Section Title − You need to know when and where to scale up or down − Bould with Load balancer and Service registry − Aggregating monitors with alers − Good, thought through metrics − processing rate - amount of processed req/sec − amount of succeeded and failed requests − length of requests queue - min, max, latest − connections status Application metrics
  • 30. ©2017 GlobalLogic Inc. Infrastructure automation - CI/CD Section Title
  • 31. ©2017 GlobalLogic Inc. Still there are much more ... Section Title
  • 34. ©2017 GlobalLogic Inc. This is cool Section Title −We haven’t even talked about −Versioning −Integration −Testing −Deployment −Security −Anti-patterns −Nanoservices −Data driven migration −...
  • 39. ©2017 GlobalLogic Inc. Literature Section Title − http://2012.33degree.org/pdf/JamesLewisMicroServices.pdf − http://www.braveterry.com/2014/04/10/presentation-service-architecture/ − http://www.pst.ifi.lmu.de/Lehre/wise-14-15/mse/microservice-architectures.pdf − https://martinfowler.com/microservices/ − http://nealford.com/downloads/Building_Microservice_Architectures_Neal_Ford.pdf − https://www.nginx.com/wp-content/uploads/2015/01/Building_Microservices_Nginx.pdf − http://transform.ca.com/API-microservice-architecture-oreilly-book.html − https://www.amazon.com/Microservices-Discover-Manage-Architecture/dp/151939733X − https://www.openshift.com/promotions/microservices.html − http://microservices.io − http://www.vinaysahni.com/best-practices-for-building-a-microservice-architecture