Sitemap

Spring Cloud Architecture

2 min readFeb 13, 2025

--

Representation of a microservices architecture on a cloud platform (ref. off. docs)

API Gateway

In microservices, there will be N number of modules that can be used in a project. For each microservices, we used to call via the context along with a port number. We should be aware of the port config for each microservice. To resolve this, The API Gateway acts as a single entry point for all client requests, handling routing, authentication, load balancing, rate limiting, and more.

Service Registry

The services registry is used to register the microservices, and that helps in service discovery, allowing microservices to dynamically register themselves and discover other services.

On using Spring Cloud Netflix provides a separate URL can see the list of services registry & status.

Config Server

Spring Cloud Config Server is used to centralize configuration management for multiple microservices. It allows services to fetch their configuration dynamically from a Git repository, file system, or database.

Circuit Breaker Dashboard

A Circuit Breaker prevents cascading failures in microservices by stopping repeated requests to failing services. In microservices, some of the API calls tend to fail again and again. In such cases, we can avoid the retry request.

The circuit breaker maintained the status as Closed/Open/Half-open.

When the API initiates the call to another microservice, If the other service is down and we maintain a threshold value of 3 calls failure consequently moved to Open status(failure rate > threshold).

Suppose the timeout expires in the Open and moves to Half-open. Allow only a few calls based on the configuration. If any of the calls are successful, then move them to Closed or else move them to Open status.

Spring Cloud Sleuth

Spring Cloud Sleuth is a distributed tracing solution for Spring Boot microservices. It adds trace IDs and span IDs to logs, allowing developers to track requests across multiple services.

Spring Cloud Bus

Spring Cloud Bus broadcasts configuration changes across microservices in a distributed system using Apache Kafka or RabbitMQ.

Without Spring Cloud Bus → Each microservice must manually refresh configs after changes in the Spring Cloud Config Server.
With Spring Cloud Bus → Changes are automatically pushed to all services in real time. Call /actuator/bus-refresh on any service to reflect the config changes.

--

--

Antony Christopher
Antony Christopher

Written by Antony Christopher

Data Science and Machine Learning enthusiast | Software Architect | Full stack developer