microservices
microservices
com/in/sumathi1989 1
Microservices
Service discovery is managed using tools like Eureka, Consul, and Zookeeper, which
help locate and manage microservices dynamically.
www.linkedin.com/in/sumathi1989 2
The Circuit Breaker Pattern helps prevent cascading failures by detecting service failures and
stopping requests to the failing service until it recovers. Netflix Hystrix (deprecated) and
Resilience4j (recommended) are popular implementations.
12. What is an API Gateway, and how does it work in Spring Boot Microservices?
An API Gateway is a single-entry point for all microservices, handling:
Authentication & Authorization
Request Routing
Load Balancing
Rate Limiting
Spring Cloud Gateway and Netflix Zuul are commonly used API Gateway solutions in Spring
Boot.
13. How do you implement inter-service communication in Microservices using Spring Boot?
Inter-service communication can be achieved using:
• REST API calls (via RestTemplate or WebClient)
• gRPC (for high-performance communication)
• Message Brokers (Kafka, RabbitMQ) for asynchronous communication
16. How do you handle transactions across multiple microservices in Spring Boot?
Microservices don’t share databases, so distributed transactions are challenging.
Possible solutions:
• SAGA Pattern (Orchestration or Choreography)
• Eventual Consistency using message queues (Kafka, RabbitMQ)
• Compensating Transactions for rollback scenarios
20. What is Spring Cloud Sleuth, and how does it help in Microservices?
Spring Cloud Sleuth is used for Distributed Tracing. It helps track requests across multiple
microservices.
• Generates trace IDs for each request.
• Works with Zipkin or Jaeger for request tracking and debugging.