Learning Spring Cloud
1. Service Decomposition and Remote Calls 1.1 Why decompose into services? As business grows, a monolith faces slow deployment, poor scalability, a frozen tech stack, and more. Microservices split it into small, independently deployable and scalable services, each responsible for a single business domain. Decomposition principles: Single responsibility: each service does one thing High cohesion, low coupling: tight within a service, loose between services Data independence: each service owns an independent database 1.2 The user-login flow (from a microservice view) Client → Gateway (auth) → business microservice A → microservice B (OpenFeign) ↓ Nacos (service discovery) 1.3 RestTemplate — the raw inter-service call RestTemplate is the HTTP client Spring provides for inter-service calls, but its code is verbose and it doesn’t support load balancing — a transitional solution before OpenFeign. ...