0% found this document useful (0 votes)
9 views14 pages

Micro Service PP T

The document discusses the transition from monolithic applications to microservices architecture, highlighting the drawbacks of monolithic systems such as maintenance challenges and scalability issues. It outlines the benefits of microservices, including independent deployability, scalability, and easier maintenance, and introduces Spring Cloud as a solution for service discovery, load balancing, and centralized configuration. An example of an e-commerce application is provided to illustrate the concepts.

Uploaded by

Anand Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views14 pages

Micro Service PP T

The document discusses the transition from monolithic applications to microservices architecture, highlighting the drawbacks of monolithic systems such as maintenance challenges and scalability issues. It outlines the benefits of microservices, including independent deployability, scalability, and easier maintenance, and introduces Spring Cloud as a solution for service discovery, load balancing, and centralized configuration. An example of an e-commerce application is provided to illustrate the concepts.

Uploaded by

Anand Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

MICROSERVICES

AGENDA

 Monolith Application
 Drawbacks of Monolithic Architecture
 Microservices, its benefits and challenges
 Spring Cloud and its components
 Example
MONOLITH APPLICATION

Monolith application refers to a application that is built as a single,


unified unit or "block." In a monolithic architecture, all the
components of the application—such as the user interface, business
logic, and data access layers—are tightly integrated and packaged
together as a single codebase and executable unit.
DRAWBACKS OF MONOLITH APPLICATION

 Maintenance Challenges: Over time, the codebase can become difficult to


maintain. Small changes in one part of the code might affect other parts,
leading to more bugs or slower development.
 Deployment Challenges: Any change to the system (even a small one)
requires redeploying the entire application, which can slow down release
cycles.
 Scalability Issues: As the application grows, it can become harder to scale
because of smaller part of the system needs more resources.
 Tight Coupling: Since all components are tightly coupled, it can be harder to
adopt new technologies, frameworks, or libraries without affecting other parts
of the application.
MICROSERVICES

Microservices is an architectural style where a large application is broken down into


smaller, independently deployable services, each responsible for a specific business
function.
Each microservice is a self-contained unit that can communicate with others via
well-defined APIs mostly by HTTP.
ADVANTAGES

 Independently Deployable: Each microservice can be developed, tested, deployed, and


scaled independently.

 Scalability: Each microservice can be scaled independently based on demand. For


example, if only the payment service experiences high traffic, it can be scaled without
scaling the entire application.

 Faster Development and Deployment: Smaller teams can work on different


microservices simultaneously, speeding up development cycles.

 Fault Isolation: If one microservice fails, it doesn’t necessarily bring down the whole
system.

 Easier Maintenance and Upgrades: Microservices make it easier to isolate bugs and
make updates without impacting other parts of the system.
SOLUTIONS BY
CHALLENGES SPRING CLOUD
Discovering all the running
Eureka Naming Server
services and their instances

Taking care of multiple service


Rest Template by Feign Client
calls

Finding easier way of load


Ribbon
balancing

Maintaining configuration of Spring Cloud Config Server


multiple services

Monitoring all the incoming API Gateway


requests to all the services

Handling Fault Tolerance Resilience4j


SERVICE
DISCOVERY

Eureka is a service discovery tool from Netflix

Different services need to communicate with each other, and service discovery helps by making
it easier for services to find each other without hardcoded IP addresses or hostnames.

Eureka provides both a Service Registry and a Client. The service registry acts as a central
directory where services register themselves and can be discovered by others.

MS-A
(8081)

Eureka Naming Server MS-C MS-C


(port:8761) (8083) (8084)
MS-B
(8082)
FEIGN AND LOAD
BALANCING

•Feign integrates with Eureka through Spring Cloud's spring-cloud-starter-openfeign dependency.


•When using Feign, instead of hardcoding the base URL for a service, you specify the service name (as registered in
Eureka).
•Feign will use the service name to look up the available service instance from Eureka at runtime.
•Ribbon is Feign’s inbuilt Client Side Load Balancer.

Eureka Naming
Server
MS-B
th cal
l (9092)
nd 4
1s a
t

Ribbon MS-B
MS-A 2 nd
call (9093)
(9091)
Client 3 rd
cal
l MS-B
(9094)
API GATEWAY

API Gateway is a key component that acts as a single entry point for all client requests to the
various microservices. It serves as an intermediary layer between the client (like a web or
mobile application) and the microservices, helping manage communication, routing, and
security.
API
Gateway
Server MS-B
Client

MS-C

MS-A
MS-D
FAULT TOLERANCE WITH
HYSTRIX

Since microservices architectures typically involve multiple independent services that


communicate over the network, failures are inevitable. Fault tolerance helps ensure that your
application can gracefully handle such failures, and continue functioning even when some
services are unavailable.

Key Concepts in Fault Tolerance:

Circuit Breaker, Retries, Timeouts, Fallbacks, Rate Limiting, Isolation:

MS-B
MS-A (Faulty Service) MS-C

Client
CENTRALIZED CONFIGURATION

In Spring Cloud, centralized configuration refers to the practice of managing configuration


properties for distributed systems (particularly microservices) in a central place, rather than
having each service maintain its own local configuration files. This approach allows for easier
management, consistent configuration across services, and the ability to update configurations
without requiring changes to individual services or redeployments.

MS-A

Spring Cloud
GIT MS-B
Repo Config Server

MS-C
EXAMPLE – E-Commerce Application
Thank You

You might also like