Microservices
Contents
 Monolithic applications
 Microservices applications
 Advantages of Microservices
 Microservices Concerns
Monolithic applications
 Demanding agility, flexibility, maintainability, high availablity and
scalability.
 it makes functionally different components of a system tightly coupled to
each other.
Microservices Architecture
 Microservices architecture, as name suggests, talks about splitting your
application into small distributed services each of which offers a specific
small business/technical functionality.
 These services are then deployed independently on different containers
(Docker, Vagrant etc.) or physical/virtual machines depending on your IT
infrastructure setup.
 However, as per Microservices architecture, these distributed services
(micro-services) should be stateless in nature so that these can easily be
replicated and scaled up/down.
 Netflix is one of the organizations that have successfully adopted
Microservices architecture.
Benefits Of Microservices
 Modular Systems - Microservices architecture makes the systems modular
by dividing these into small services (micro-services).
 Targeted Scaling - Scaling monolithic application is not efficient. E.g. a
blog application contains services for fetching and saving blogs. While
blog saving service will have low load, blog fetching service will have huge
load comparatively. In order to scale monolithic application, we would
need to replicate whole application on more machines. While this will help
us cope up with work load, it is not an efficient approach since we also
replicated blog saving service. With Microservices, we could separate it
into two different services and then scale either of these without touching
other one.
Benefits Of Microservices
 Agile Systems - It also helps achieve agility as smaller services can
independently be updated/modified. This allows us to do quick releases
containing new functionality / bug fixes and, ultimately, improved user
experience and trust.
 High Availability - Since micro-services are stateless in nature, these can
be replicated at run time in case of machine failures.
 Polyglot Systems - Microservices architecture also allows us to leverage
various technologies / programming languages as all the services are
separately developed, deployed and maintained. This makes our system
more resource effective and high performant as we can use right tool for
right job.
Microservices Concerns
 Containerisation - Micro-services should ideally be deployed in
lightweight containers that can be added/removed dynamically. For example,
you could deploy your distributed services in Docker/Vagrant containers
with Docker Swarm/Kubernetes automating deployment, scaling and
management of these.
 Service Discovery - While we can segregate our application into small
distributed services, these can't work in isolation and often need to call other
services. Since our services are agile and containerised, their address (host,
port, other metadata) keep on changing. To avoid any problems in inter-
service communication, a Service Registry is used. All the services register
with this at the time of starting up. With this, whenever a Service needs to
call another one, it first goes to Service registry to fetch target service details.
Hence, this ensures seam-less communication between services. There are
many frameworks available for Service discovery such as Eureka, Consul,
ZooKeeper etc.
Microservices Concerns
 Service Load Balancing - While we can look up Service address details
from Service registry, we also need to have load balancing to ensure that
we are utilizing all the service instances. This is where load balancing
comes into picture. This can be done at either server side or client side
using tools such as Ribbon, Zuul, Nginx etc.
 Service Tracing - After we are all done with seamless inter-service
communication, we face the challenge of debugging functional and
technical issues. This debugging is often troublesome as a request is
usually served by multiple distributed services. However, we can make
our requests traceable by employing a service tracing/monitoring system
such as ZipKin, Sleuth, Prometheus etc.
Microservices Concerns
 Service Circuit Breaker - Circuit breakers are useful in controling the
interactions between distributed services by adding latency tolerance and
fault tolerance logic. It also helps in stopping cascading failures across
them, and providing fallback options, all of which improve your system’s
overall resiliency. Hystrix is one such tool providing circuit breaker
functionality.
 Service Templates - Since we can end up a lot of distributed services,
making these consistent is often challenging. Service templates help us in
this respect by providing a base project that teams should build on. This
also helps in streamlining the technologies, frameworks and tools acorss
various teams. For example, Maven archetypes can be used as Service
templates that each of the teams can use to create projects.
Thank You !!!

Microservices

  • 1.
  • 2.
    Contents  Monolithic applications Microservices applications  Advantages of Microservices  Microservices Concerns
  • 3.
    Monolithic applications  Demandingagility, flexibility, maintainability, high availablity and scalability.  it makes functionally different components of a system tightly coupled to each other.
  • 4.
    Microservices Architecture  Microservicesarchitecture, as name suggests, talks about splitting your application into small distributed services each of which offers a specific small business/technical functionality.  These services are then deployed independently on different containers (Docker, Vagrant etc.) or physical/virtual machines depending on your IT infrastructure setup.  However, as per Microservices architecture, these distributed services (micro-services) should be stateless in nature so that these can easily be replicated and scaled up/down.  Netflix is one of the organizations that have successfully adopted Microservices architecture.
  • 5.
    Benefits Of Microservices Modular Systems - Microservices architecture makes the systems modular by dividing these into small services (micro-services).  Targeted Scaling - Scaling monolithic application is not efficient. E.g. a blog application contains services for fetching and saving blogs. While blog saving service will have low load, blog fetching service will have huge load comparatively. In order to scale monolithic application, we would need to replicate whole application on more machines. While this will help us cope up with work load, it is not an efficient approach since we also replicated blog saving service. With Microservices, we could separate it into two different services and then scale either of these without touching other one.
  • 6.
    Benefits Of Microservices Agile Systems - It also helps achieve agility as smaller services can independently be updated/modified. This allows us to do quick releases containing new functionality / bug fixes and, ultimately, improved user experience and trust.  High Availability - Since micro-services are stateless in nature, these can be replicated at run time in case of machine failures.  Polyglot Systems - Microservices architecture also allows us to leverage various technologies / programming languages as all the services are separately developed, deployed and maintained. This makes our system more resource effective and high performant as we can use right tool for right job.
  • 7.
    Microservices Concerns  Containerisation- Micro-services should ideally be deployed in lightweight containers that can be added/removed dynamically. For example, you could deploy your distributed services in Docker/Vagrant containers with Docker Swarm/Kubernetes automating deployment, scaling and management of these.  Service Discovery - While we can segregate our application into small distributed services, these can't work in isolation and often need to call other services. Since our services are agile and containerised, their address (host, port, other metadata) keep on changing. To avoid any problems in inter- service communication, a Service Registry is used. All the services register with this at the time of starting up. With this, whenever a Service needs to call another one, it first goes to Service registry to fetch target service details. Hence, this ensures seam-less communication between services. There are many frameworks available for Service discovery such as Eureka, Consul, ZooKeeper etc.
  • 8.
    Microservices Concerns  ServiceLoad Balancing - While we can look up Service address details from Service registry, we also need to have load balancing to ensure that we are utilizing all the service instances. This is where load balancing comes into picture. This can be done at either server side or client side using tools such as Ribbon, Zuul, Nginx etc.  Service Tracing - After we are all done with seamless inter-service communication, we face the challenge of debugging functional and technical issues. This debugging is often troublesome as a request is usually served by multiple distributed services. However, we can make our requests traceable by employing a service tracing/monitoring system such as ZipKin, Sleuth, Prometheus etc.
  • 9.
    Microservices Concerns  ServiceCircuit Breaker - Circuit breakers are useful in controling the interactions between distributed services by adding latency tolerance and fault tolerance logic. It also helps in stopping cascading failures across them, and providing fallback options, all of which improve your system’s overall resiliency. Hystrix is one such tool providing circuit breaker functionality.  Service Templates - Since we can end up a lot of distributed services, making these consistent is often challenging. Service templates help us in this respect by providing a base project that teams should build on. This also helps in streamlining the technologies, frameworks and tools acorss various teams. For example, Maven archetypes can be used as Service templates that each of the teams can use to create projects.
  • 11.