Spring Cloud and its advantages

Upasana | December 25, 2019 | 2 min read | 169 views


What is Spring Cloud? What are advantages of using Spring Cloud?

There are lot of challenges in developing distributed microservices without a proper framework support, which includes: service discovery issues, latency overhead, redundancy handling, load-balancing issues, security issues and finally deployment and logging issues.

Spring team has integrated number of battle-tested open source projects from companies like Pivotal, Netflix, HashiCorp, etc into a Spring project known as Spring Cloud. Spring Cloud provides libraries & tools to quickly build some of the common design patterns of distributed system, including the following:

Service discovery

JVM and non JVM services can register themselves into service registry and easily discover other services available in the ecosystem. Spring Cloud Netflix Eureka or Consul can be used for this purpose.

Distributed configuration

Centralized external configuration management backed by a git repository. The configuration resources map directly to Spring Environment but could be used by non-Spring applications if desired.

Client side loadbalancing

Load balancing improves the distribution of workloads across multiple services. Spring Cloud provides Ribbon - a client side load balancer that talks to Service Registry and makes load balancing easy.

Circuit Breaker

Circuit breaker allows graceful degradation of functionality when a method call on a service fails. Use of the Circuit Breaker pattern can allow a microservice to continue operating when a related service fails, preventing the failure from cascading and giving the failing service time to recover. Spring Cloud provides Hystrix which is a implementation for circuit breaker pattern.

Routing

Spring Cloud Gateway is an intelligent and programmable router based on Project Reactor.

Log Tracing

Spring cloud provides Zepkin and Sleuth that can be used for Log Correlation and Tracing. This is very helpful in real production environment for in depth troubleshooting.

Security

Spring cloud provides support for OAuth2 server and resource service by use of few annotations. Authorization and Authentication can be easily implemented using these libraries.


Top articles in this category:
  1. What is Spring Boot and what are its advantages
  2. 50 microservices interview questions for Java developers
  3. Cracking Spring Microservices Interviews - question bank
  4. Is it a good practice to deploy multiple microservices in a single tomcat container
  5. How will you Partition a typical e-shop into Microservices Architecture
  6. Why Microservices are better than Monoliths

Recommended books for interview preparation:

Find more on this topic: