Spring Microservices
Spring Microservices
Architecture
Need of Spring Cloud 4
is it ?
it ?
Load balancer aims to distribute traffic to a
microservice among its multiple instances so that
no single instance gets overwhelmed by traffic
Load balancer can make user of service
discovery to find out about available service
instances
Load balancing can be done on client side or
server side
Spring - Service discovery 7
What is it ?
Store configuration of a microservice in an
external location
This enables
Run application in multiple environments without
modification or recompilation
Update application configuration without
changing application code
Spring – External 10
configuration
Spring Cloud Config provides server and client-side
support for externalized configuration in a distributed
system. Spring supports integration to following
external configuration tools
Consul – Uses consul’s key/value store
Zookeeper – Use zookeeper as a data store
Kubernates - PropertySource objects configured
via ConfigMaps
Important annotation
@RefreshScope – Reinitializes the bean when
there is a configuration change
Messaging – What is it ? 11
?
Circuit breakers gracefully degrade functionality
when a method call fails
Use of the Circuit Breaker pattern can allow a
microservice to continue operating when a
related service fails, preventing the failure from
cascading and giving the failing service time to
recover.
Spring cloud support for 14
circuit breakers
Provides an abstraction across different circuit
breaker implementations.
Supported implementations:
Retry
Resiliance4j
Sentinel
Note:- Hystrix is deprecated
Important annotations and classes:
@EnableCircuitBreaker
CircuitBreakerFactory – Use this to create a circuit
breaker in your code
Tracing – What is it ? 15
reference
Source: Official Spring documentation
Follow Amol Limaye to more see such content in
your feed
https://www.linkedin.com/in/amolrlimaye/