Introduction to Spring Cloud

Introduction to Spring Cloud

Hello friends, this is really nice that you are staying with the Microservice journey.  In this article, we discuss about Spring cloud which is now well-known topic within Microservices community.

Spring cloud is a developer kit for developing internet-scale spring boot  applications suitable for microservice implementation style. Spring boot is a microservice implementation framework. Spring Cloud is essentially an implementation of various design patterns to be followed while building Cloud Native applications. Instead of reinventing the wheel, we can simply take advantage of various Spring Cloud modules and focus on our major business problem rather than worrying about infrastructural concerns.

Spring Cloud is an initiative from Spring that implements common distributed system patterns and easy to use java spring libraries. Spring cloud is not a cloud solution but it is a cloud ready deployment framework and is agonistic for deployment in any cloud platform. Thus you can deploy IT solution built using Spring Cloud framework in AWS , Heroku , IBM Cloud , Cloud Foundry etc. cloud platforms.

Spring cloud saves developers time by providing many boilerplate codes out of the box. This facilitates the productivity and efficiency of developers and overall software delivery.

Spring Cloud provides many choices for developers based on their requirements. For example service registry can be implemented in Eureka , Consul or Zookeper . Lets try to understand the differences between Spring Cloud and Netflix OSS frameworks which are vastly compared nowadays.

Spring Cloud and Netflix

Most of the spring cloud components which are critical for microservice deployment came from Netflix OSS. Netflix is a pioneer and early adaptor of microservices. They came up with many techniques for managing microservices in AWS platform. Latter they open sourced these components and made them publicly available.

Spring cloud offers higher level abstraction over Netflix OSS components and made them more java developer friendly or more specifically spring friendly. Spring cloud provides spring centric framework for integrating with Netflix platform service components like : Config Server , Eureka , Hystrix , Turbine , Feign , Ribbon , Zuul

Spring Cloud Capabilities

  • Externalized and centralized configurationsConfigurations are hard to manage when there are large number of microservices running in different profiles. So configurations should be managed centrally in a controlled fashion. Spring cloud config server maintains the configurations in SCM tool. Spring Cloud bus provides support for propagating the changes to all subscribers.
  • Service registry and service discoveryThis enables business services to programmatically register with services registry , advertises their existence and make them discoverable. Consumers look up the registry to invoke them programmatically.
  • Load Balancing Ribbon supports client side load balancing. This is different from hardware load balancers , load balancers for virtual boxes and load balancers across the containers.
  • Declarative rest based service to service communication Feign supports rest based service to service communication. Feign is integrated with Eureka and ribbon.
  • Circuit Breaker The circuit breaker breaks the circuit when it encounters failures in primary flow and diverts the traffic to an alternative temporary flow. It also seamlessly diverts the traffic to the primary flow when the primary flow is available.
  • Reverse Proxy Zuul component implements this pattern. It intercepts user requests and forwards the request to the business services. Zuul is a lightweight API gateway component and is integrated with Eureka.
  • Security This is required for cloud native distributed system using externalized authorization providers like OAuth2. This also provides SSO capability which is essential when dealing with multiple microservices. Any feature out of the box from Spring Cloud framework ?

I will recommend here to re-visit our “microservice-comparison-with-soa-and-12-factor-cloud-principles” blog and have a look at 12 Factor Cloud Principles. The combination of Spring Boot and Spring Cloud frameworks enable us to address these principles.

In the next blogs we will discuss about each of the above components with details and hands on examples.

Keep in touch and keep visiting


Author: Debajyoti Mukherjee

Debajyoti Mukherjee has more than 11 years if IT experience in application design , application development. He has worked in large MNCs and has worked for eminent clients. He is proficient in custom development , cloud platform , microservice based application migration.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.