learnAndImprove
learnAndImprove

Reputation: 1359

Deploying Spring PetClinic Microservices to AWS

In the process of learning AWS, I decided to try and deploy spring petclinic microservice app build on top of the spring cloud netflix technology stack taken from here

https://github.com/spring-petclinic/spring-petclinic-microservices

But, the more I read about AWS I wonder if it makes sense. My understanding is that AWS offers most of the services like discover, gateway, load balancing natively. Is this correct?

If so, how would one go about deploying spring petclinic to AWS in a meaningful way?

Upvotes: 1

Views: 918

Answers (1)

Gregorio Palamà
Gregorio Palamà

Reputation: 1952

Your question totally makes sense.

Netflix OSS was developed in a period of time where Container orchestration's maturity was not the one we know nowadays. Today, with Kubernetes, services like EKS (for AWS, Kubernetes Engine for GCP, AKS for Azure) and a lot of new services and requirements, we have a lot more of stuff to deal with.

For instance, the first problem that the Netflix OSS solves, the Service Discovery, requires Eureka server. If we think at a IaaS world, it totally makes sense: we need a block, in our architecture, that knows about all the services in our system. If we think to a system that uses containers and orchestrators, such as Kubernetes, we realize that K8S already offers funcionalities like the one that Eureka offers. With this in mind, it results clear that adding a pod in our K8S cluster just to serve Eureka server would be a total waste of resources. We can then rely on the underlying platform.

With this consideration (and a lot more), Spring Cloud project has evolved, becoming more of a standardization incubator, with a lot of implementations. I'll give you some examples and I'll also give you a complete list of Netflix OSS equivalents:

  • Eureka, for Service Discovery. We can use Kubernetes's API Server for this, so we can switch to Spring Cloud Kubernetes
  • Hystrix, the Circuit Breaker. Spring Cloud Circuit Breaker is the new project for this. It is an abstraction, and can uses some implementations, such as Hystrix itself, but also Resilience4J, that I kindly suggest, or Sentinel
  • Feign, as REST Client. There is a new implementation, outside the Netflix stack: Spring Cloud OpenFeign
  • Ribbon, for a client side load balancing. You can switch to Spring Cloud LoadBalancer
  • Config. This is pretty nice, because we have the Spring Cloud Config project, but if we add the Spring Cloud Kubernetes dependency we can also rely on K8S's ConfigMaps and Secrets for this, and Spring Cloud Config automatically uses them
  • Zuul, the router and gateway. You can migrate to Spring Cloud Gateway, and it is already integrated with all the new projects

--EDIT--

Forgot to mention: when you are using a PaaS, you can stick to a lot of services. An example could be AWS API Gateway. Have a look at this page for a full list of Spring Cloud project. A lot of them adds support and integration to basically almost every PaaS.

Upvotes: 3

Related Questions