Back to Microservice Course

Microservice Course

Why Spring Cloud is Required?

Spring Cloud is a suite of tools and libraries built on top of Spring Boot that solves the most common operational challenges of running microservices in a distributed environment. It provides production-proven implementations of patterns like service discovery, centralized configuration, distributed tracing, circuit breaking, and API gateway routing.

The original Spring Cloud Netflix stack (which this content was based on) has evolved significantly. Several Netflix OSS libraries are now in maintenance mode or deprecated, and the Spring Cloud project has introduced modern replacements. Below is the current, accurate picture:

Challenge | Original (Legacy) Solution | Current Recommended Solution -----------------------------------|-----------------------------|------------------------------------------------------------------------- Service Registry & Discovery | Netflix Eureka | Netflix Eureka (still actively supported) Client-Side Load Balancing | Netflix Ribbon | Spring Cloud LoadBalancer (Ribbon is in maintenance mode) Centralized Configuration | Spring Cloud Config | Spring Cloud Config (still current) Distributed Tracing | Spring Cloud Sleuth | Micrometer Tracing + Zipkin/Jaeger (Sleuth merged into Micrometer 3.x) Circuit Breaker / Fault Tolerance | Netflix Hystrix | Resilience4j (Hystrix is in maintenance mode, no longer developed) API Gateway | Netflix Zuul | Spring Cloud Gateway (Zuul is in maintenance mode)

What Spring Cloud Provides

  • Netflix Eureka: Service registry and discovery (Naming Server). Microservices register themselves on startup and discover other services by logical name rather than hardcoded host/port. Still the most commonly used option for self-hosted service discovery in Spring Boot ecosystems.
  • Spring Cloud LoadBalancer: Client-side load balancing across multiple instances of a service — the replacement for Netflix Ribbon. Integrates automatically with Eureka and with @LoadBalanced RestTemplate or WebClient.
  • Spring Cloud Config: Externalized, centralized configuration backed by a Git repository (or Vault, filesystem, etc). All microservices pull their environment-specific config from one place, without embedding it in their JARs.
  • Micrometer Tracing (formerly Spring Cloud Sleuth): Distributed tracing — adds trace and span IDs to log output and propagates them across service boundaries via HTTP headers or messaging. Integrates with Zipkin and Jaeger for trace visualization. As of Spring Boot 3.0 / Spring Cloud 2022+, Sleuth has been replaced by Micrometer Tracing.
  • Resilience4j: Fault tolerance — circuit breaker, retry, rate limiter, bulkhead patterns. The modern, actively maintained replacement for Hystrix, designed for Java 8+ and functional programming.
  • Spring Cloud Gateway: API gateway — a fully reactive, non-blocking gateway built on Spring WebFlux. Handles routing, load balancing, request filtering, authentication, rate limiting, and monitoring at the edge. The replacement for Netflix Zuul.

screenshot of the app