What is Spring Cloud and its relationship to Spring Boot?
Why Interviewers Ask This
Mid-level Spring Boot roles require deep understanding of this topic. Interviewers ask this to separate candidates who truly understand the mechanics from those who only know surface-level concepts.
Answer
Spring Cloud is an umbrella project providing a set of tools for building distributed systems and microservices on top of Spring Boot. Each Spring Cloud module addresses a specific distributed systems pattern. Key Spring Cloud components: (1) Spring Cloud Netflix (legacy): Eureka (service registry/discovery), Ribbon (client-side load balancing — deprecated), Hystrix (circuit breaker — deprecated); (2) Spring Cloud OpenFeign: declarative REST client: @FeignClient(name = "payment-service") interface PaymentClient { @PostMapping("/payments") Payment createPayment(@RequestBody PaymentRequest req); }; (3) Spring Cloud LoadBalancer: Ribbon replacement for client-side load balancing; (4) Spring Cloud Config: centralized configuration server — serves properties from Git, Vault, or filesystem to all microservices; (5) Spring Cloud Gateway: API gateway built on Spring WebFlux — routing, filtering, rate limiting; (6) Spring Cloud Sleuth (now Micrometer Tracing): distributed tracing with correlation IDs across services; (7) Spring Cloud Stream: messaging abstraction over Kafka, RabbitMQ — publish/subscribe; (8) Resilience4j: circuit breaker, retry, rate limiter, bulkhead (replaced Hystrix): @CircuitBreaker(name = "paymentService", fallbackMethod = "paymentFallback"); (9) Spring Cloud Contract: consumer-driven contract testing between microservices. Service discovery with Eureka: services register themselves; clients discover service instances by name instead of hardcoded URLs.
Pro Tip
Demonstrate both theoretical understanding and practical experience. Say what it is, then give an example of how you actually used it in a Spring Boot codebase.
More Spring Boot Questions
View all →- Intermediate What is Spring AOP (Aspect-Oriented Programming)?
- Intermediate What is Spring Boot caching with @Cacheable?
- Intermediate What is Spring Data JPA query methods and JPQL?
- Intermediate What is Spring Boot REST API best practices?
- Intermediate What is Spring Boot JWT authentication implementation?