Skip to main content

Spring Cloud vs AWS/GCP/Azure Cloud - In the realm of Distributed Systems Development


The Scalability and High-Availability have become defacto standards for Distributed Systems development. The traditional applications are moving fast from the On-Prem model to the Cloud.
With such requirements, it has become imperative to build an application with robust APIs or Cloud Services having fault-tolerant and graceful fallback functionality.

Spring framework has emerged as a full-fledged, robust, feature-rich and mature ecosystem over time. It has been equipped with lots of features for rapid development. Spring Boot dominates the Cloud Native Software development. With the introduction of Spring Boot, the Microservices development has catapulted to a whole new level as it brings all sorts of dependencies in one place.

Spring Cloud is an umbrella project under the Spring ecosystem. It consists of many sub-projects to build a robust distributed system. It was primarily developed by Netflix and open-sourced as part of Netflix OSS to create resilient, fault-tolerant and scalable microservices. Spring Cloud provides below discrete APIs:

Eureka - Service Discovery API
Feign Client - Microservices communication API
Hystrix - Latency and fault-tolerance API
Ribbon - Client Side Load Balancing API
Zuul - API Gateway (Routing API)

Amidst the surge of cloud providers like AWS, Azure and GCP, and already available Spring Cloud, one wonders how Spring Cloud(Netflix libraries) fits into an application development when the above-mentioned cloud libraries are already available as Cloud Services from AWS, GCP or Azure. It leads to developers confusion on whether to use Spring Cloud APIs or use a combination of AWS ELB/Route53 cloud services (or similar GCP or Azure services) to build highly scalable microservices .

To understand the basics of Cloud, first understand the difference between Infrastructure, Applications, and Platform. Think of infrastructure as hardware: Storage(disk), Servers, Compute, Network routing etc. Then, visualize the 'application' as the executable that you build from your code to implement the business logic for the end-users. The Platform is an interface between Infrastructure and Applications. It is a connecting layer for tools and standards to help your applications make use of infrastructure.

AWS/Azure/GCP being a leading Cloud player provides lots of services in all three categories : Infrastructure(IAAS), Applications(SAAS) and Platforms(PAAS). AWS is most famous for providing cloud infrastructure but it also provides a lot of services that could fall under Platform and Applications. For instance, it provides container orchestration services, API gateway services with EKS (Kubernetes)/ECS(containers) and AWS API Gateway service respectively. These are platform-level services to help your applications to scale and to talk to each other in the cloud.

Spring Cloud is a set of APIs, libraries and tools that help you address common problems faced by distributed cloud applications. Concerns like how to do service discovery (eureka), how to implement circuit-breaker pattern for a graceful fallback in case a particular microservice fails (hystrix), how to communicate among microservices in the cloud (feign client), how to provide load balancing capability to your applications(ribbon), how to provide a single entry point to access a set of microservices (zuul) and how to manage configuration across microservices (spring cloud config).

One important point to note is that the Netflix cloud stack has been built to run independently without any managed services from a cloud provider like AWS or GCP or Azure.

Hence, it leaves Architects and Developers with below choices:

1) One can get the required number of virtual machines on AWS or Azure and deploying the complete Netflix software stack himself. GCP or AWS could be used just as infrastructure provider(IAAS).

2) Another option is to use only AWS or Azure managed services and no Netflix tech stacks (for instance, AWS Load Balancer instead of Ribbon, AWS API Gateway instead of Zuul, and AWS Kubernetes for container hosting/ service discovery, AWS Cognito instead of Spring Security, etc). This means one can use AWS as a platform and software service provider in addition to the infrastructure (IAAS + PAAS + SAAS).

3) The third option is to use any combination of the above two scenarios. For instance, use AWS for load balancing but deploy some Zuul Gateways on your EC2 instances as a common entry point to your application.

In nutshell, the general idea is : The software elements of our architecture if managed by ourselves with in-built cloud functionalities will be cheaper in baseline costs than availing third party cloud services, but there will be additional design/development/administration costs. What is best for us depends on our use cases, scalability requirements, resource availability, etc.

Pankaj




Comments

Popular posts from this blog

Program "make" not found in PATH in Eclipse

In order to fix the error "Program "make" not found in PATH in Eclipse", follow below steps: Right Click on the Project -> Properties -> C/C++ Build ->Environment Check PATH, if it has C:\cygwin64\bin in the path or not. Sometimes path set in Environment variables is not reflected in the Eclipse, so you have to edit it here. Build/Restart the eclipse again, you should be able to get rid of the error. If it still persists, do right click on the Project -> Properties -> C/C++ Build ->Tool Chain Editor Current toolchain: ->Cygwin GCC Current builder: -> GNU Make Builder It should work now !! Pankaj

Create the Vsix package from a class library

A project that was created as a class library that contains numerous controls that can be used in windows forms applications. In order to create an installation package (*.vsix) that will embed these controls into the visual studio toolbox window. The controls are visible in the toolbox window when being in the solution that has this project within itself. I have created a vsix project and referenced the component project's dll as a Microsoft.VisualStudio.Assembly asset. The VS2017 build process creates the vsix file that I need. When I run it on a system with a fresh VS installation, it goes through the install process with no problems, but the components don't show up in the toolbox. When I try to register the asset as a Microsoft.VisualStudio.ToolboxControl, I get the error 'The target "PkgdefProjectOutputGroup" does not exist in the project.  To reslolve the below error which comes while adding reference of DLL application to VSIX project for Visual ...