Backend Development 19 min read

Spring Cloud Core Knowledge Summary and Frequently Asked Interview Questions

This article provides a comprehensive overview of Spring Cloud, covering its core components, microservice concepts, service discovery, load balancing, circuit breaking, configuration management, and practical interview questions with code examples such as Eureka, Feign, Ribbon, and Hystrix.

Top Architect
Top Architect
Top Architect
Spring Cloud Core Knowledge Summary and Frequently Asked Interview Questions

In this article, a senior architect shares a concise summary of Spring Cloud fundamentals and a collection of high‑frequency interview questions for backend developers.

Spring Cloud Core Components

An illustration (omitted) shows the relationships among the main Spring Cloud modules such as Eureka, Feign, Ribbon, Hystrix, Zuul, Config, and Bus.

Key Concepts

1. What is Spring Cloud?

Spring Cloud builds on Spring Boot to provide a suite of tools for building distributed micro‑service applications and integrating with external systems.

2. What is a microservice?

A microservice is an independently deployable unit that implements a single business capability, typically packaged as a Maven module and run on its own JVM.

3. Advantages of Spring Cloud

Handles distributed system complexities such as network latency, security, and bandwidth.

Provides service discovery, load balancing, redundancy, and performance tuning.

Simplifies deployment and DevOps requirements.

4. Service Communication

Synchronous calls use RPC frameworks like Dubbo or REST/JSON APIs; asynchronous communication relies on message queues such as RabbitMq , ActiveM , and Kafka .

5. Circuit Breaker and Fallback

Hystrix implements circuit breaking: when a service fails repeatedly, calls are short‑circuited and a fallback method (annotated with @HystrixCommand(fallbackMethod="XXX") ) returns a default response. Enable it with @EnableHystrix .

6. Eureka vs. Zookeeper

Eureka favors AP (availability and partition tolerance) while Zookeeper guarantees CP (consistency and partition tolerance). Eureka’s self‑protection mode prevents accidental deregistration during network glitches.

7. Spring Boot vs. Spring Cloud

Spring Boot focuses on rapid development of individual services; Spring Cloud adds global concerns such as configuration management, service discovery, routing, and fault tolerance.

8. Load Balancing

Load balancers distribute traffic across multiple instances to improve resource utilization, throughput, and reliability.

9. Hystrix Fault Tolerance

Hystrix isolates remote calls, provides thread pools, and prevents cascading failures in distributed systems.

10. Service Registration

Services register with a discovery server (e.g., Eureka or Zookeeper) using @EnableEurekaServer on the server side and @EnableDiscoveryClient on the client side, then communicate via Ribbon or Feign.

11. Service Degradation

When a service is circuit‑broken, a fallback response ensures the system remains partially functional instead of failing completely.

12. Eureka Self‑Protection

If a Eureka node loses many heartbeats, it enters self‑protection mode, preserving registration data until the network stabilizes.

13. Ribbon

Ribbon is a client‑side load‑balancer; it is automatically integrated into Feign ( feign默认集成了ribbon ).

14. Netflix Feign

Feign is a declarative HTTP client inspired by Retrofit and JAX‑RS, supporting annotation‑based interfaces, Ribbon load‑balancing, and Hystrix circuit breaking.

15. Ribbon vs. Feign

Ribbon requires manual HTTP request construction and is enabled with @RibbonClient ; Feign uses annotated interfaces and is enabled with @EnableFeignClients .

16. Core Spring Cloud Components

Eureka – service registration and discovery.

Feign – declarative REST client.

Ribbon – client‑side load balancer.

Hystrix – circuit breaker and thread isolation.

Zuul – API gateway.

17. Spring Boot & Spring Cloud Relationship

Spring Cloud depends on Spring Boot; Spring Boot can be used independently, but Spring Cloud cannot run without it.

18. Independent Service Communication

Two approaches: direct RPC (simple request/response) and asynchronous messaging (queues, topics) which decouple producers and consumers.

19. Service Registration in Spring Cloud

Services publish their name to a registry ( Eureka or Zookeeper ) using @EnableDiscoveryClient , then other services discover them via Ribbon or Feign.

20. Service Circuit Breaking

When a service becomes unresponsive, Hystrix opens the circuit to stop further calls and returns fallback data, preventing cascade failures.

21. Eureka Self‑Protection Details

During network partitions, Eureka stops removing stale instances and continues to accept new registrations, ensuring high availability.

22. Spring Cloud Bus

Bus links distributed nodes via a lightweight message broker, enabling broadcast of configuration changes and inter‑service communication.

23. Purpose of Spring Cloud Circuit Breaker

It isolates failing calls, opens the circuit after a threshold, and later tests recovery before closing.

24. Spring Cloud Config

Provides a centralized configuration server ( @EnableConfigServer ) and client ( @EnableConfigClient ) that can source properties from local files or remote Git repositories.

25. Spring Cloud Gateway

Second‑generation API gateway that replaces Zuul, offering route predicates and filters for routing, authentication, and rate limiting.

The article concludes with an invitation for readers to discuss these topics, join a community group, and access additional interview material.

microservicesservice discoveryfeignEurekaSpring CloudHystrixribbon
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.