Understanding Microservices: Concepts, Communication, Spring Cloud vs Dubbo, and Related Technologies
This article explains what microservices are, how they communicate, compares Spring Cloud and Dubbo, describes the relationship between SpringBoot and SpringCloud, defines circuit breaking and service degradation, outlines microservice advantages and pitfalls, and lists common microservice technology stacks and tools.
1. What is a microservice? A microservice is a lightweight, single‑purpose service that can run independently, focusing on a specific business function. It forms part of a distributed system, addressing complex business needs by dividing applications into small, loosely coupled modules.
Martin Fowler notes that microservices lack a single standard definition but generally refer to an architectural style where an application is split into many small services, each running in its own process and communicating via lightweight mechanisms.
2. How do microservices communicate? Communication can be synchronous, using RPC frameworks like Dubbo or REST/JSON APIs via Spring Cloud, or asynchronous through message queues such as RabbitMQ, ActiveMQ, or Kafka.
3. Differences between Spring Cloud and Dubbo
Both are distributed management frameworks. Dubbo uses binary transmission, consuming less bandwidth, while Spring Cloud relies on HTTP/JSON, which is more bandwidth‑intensive but offers looser coupling and easier integration.
Maximum difference: Spring Cloud abandons Dubbo's RPC communication and adopts HTTP‑based REST.
Strictly speaking, each approach has pros and cons; REST is more flexible and avoids strong code‑level dependencies, which suits fast‑evolving microservice environments.
4. Relationship between SpringBoot and SpringCloud SpringBoot focuses on rapid development of individual microservices, whereas SpringCloud provides governance and coordination for a collection of those services. SpringBoot can operate independently, but SpringCloud depends on SpringBoot.
5. Circuit breaking and service degradation Circuit breaking acts like a fuse, stopping calls to an unhealthy service to prevent system‑wide failure. Service degradation returns predefined fallback responses for non‑critical functions under high load, preserving overall system stability.
6. Advantages and disadvantages of microservices Advantages include loose coupling, focused functionality, language‑agnostic development, easier fault isolation, and flexible technology choices. Disadvantages involve increased operational complexity, deployment overhead, higher resource consumption, communication overhead, data consistency challenges, and monitoring difficulty.
7. Eureka vs Zookeeper for service registration Zookeeper follows the CP model (strong consistency), while Eureka follows the AP model (high availability). Zookeeper may experience downtime during leader election, whereas Eureka remains available as long as any node is up.
8. Common microservice technology stack
Microservice Item
Implementation
Service Development
SpringBoot, Spring, SpringMVC
Service Configuration & Management
Archaius, Dlamond
Service Registry & Discovery
Eureka, Consul, Zookeeper
Service Invocation
REST, RPC (Dubbo), gRPC
Circuit Breaker
Hystrix, Envoy
Load Balancing
Nginx, Ribbon
Client‑side Simplification
Feign
Message Queues
Kafka, RabbitMQ, ActiveMQ
Configuration Center
Spring Cloud Config, Chef
API Gateway
Zuul
Monitoring
Zabbix, Nagios, Metrics, Spectator
Tracing
Zipkin, Brave, Dapper
Deployment
Docker, OpenStack, Kubernetes
Data Stream SDK
Spring Cloud Stream (Redis, Rabbit, Kafka)
Event Bus
Spring Cloud Bus
9. What is microservice architecture? It is the orchestration layer that manages and integrates multiple microservices, similar to a hospital where each department (microservice) is coordinated by an overarching system (architecture).
References: Martin Fowler’s blog, various CSDN articles, and related technical documentation.
Selected Java Interview Questions
A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.