Basics of Microservice Architecture
Presenter: Souvik Ghosh
TOPICS OF DISCUSSION
What is Microservice?
What is Monolithic Architecture and It’s Drawbacks
Why to Use Microservice Architecture?
Challenges in Microservices Implementation and How to Resolve It
What is Service Discovery and Eureka?
Calling Another Microservice and Load Balancing
Use of API Gateway
Fault Tolerance With Hystrix
Centralized Configuration Using Spring Cloud Config Server
A Sample Microservices Architecture
What are Microservices?
Application a1 Application a2
Application A
Application a3 Application a4
Monolithic Architecture Microservices
Architecture
Drawbacks of Monolithic Architecture
1. Large monolithic code base is very difficult to understand
2. It’s not fault tolerant
3. Overloaded Web Container and Overloaded IDE
4. Frequent deployment is difficult
5. Scaling the application is difficult
6. “A monolithic architecture forces you to be married to the technology stack
(and in some cases, to a particular version of the technology) you choose at
the start of the development.”
Why Microservice Architecture?
1. Code base is better understandable
2. Highly maintainable and testable - enables rapid and frequent
development and deployment
3. Loosely coupled with other services so independently deployable
4. Improved fault isolation
5. Adapting new technologies is easier
6. The faster IDE makes developer more productive
Challenges in Microservices Implementation
and Solutions
Discovering all the running services and
Eureka Naming Server by Netflix OSS
their instances
Rest Template by Spring Frameworks
Taking care of multiple service calls
Feign Client by Netflix OSS
Finding easier way of load balancing Ribbon by Netflix OSS
Maintaining configuration of multiple Spring Cloud Config Server
services
Monitoring all the incoming requests to Zuul API Gateway by Netflix OSS
all the services
Handling Fault Tolerance Hystrix By Netflix OSS
What is Service Discovery?
Eureka
Eureka Naming Server http://
(port:8761) localhost:8761
Ms-A running on port 8081
Ms-B running on port 8082
Ms-C Ms-C running on port 8083 &
Ms-A Ms-B (8083) 8084
(8081) (8082)
Ms-C
(8084)
Calling Another Microservice and Load Balancing
Eureka Naming Server
Ms-B
4 call
th
(9092)
d
1st an
Ribbon Ms-B
Ms-A 2nd call
(9093)
(9091)
Client 3 rd c
all Ms-B
(9094)
Use of API Gateway
Zuul API
Gateway
Server Ms-B
Client
Ms-C
Ms-A
Ms-D
Fault Tolerance With Hystrix
Ms-B
(Faulty Service)
Ms-C
Ms-A
Client
Faulty Ms-B returns a default output to make the other services safe
Centralized Configuration By Config Server
Ms-A
Spring Cloud Config
GIT Ms-B
Server
Repo
Ms-C
Storing All Configurations in a GIT Repository
Sample
Microservic
es
Architectur
e
Thank You