Skip to content

technologies problems between environemnts (dev and prod)

0

I want to build a microservices application, with some microservices in spring boot and other in fastapi. I have many confusions between running the project in local vs in prod : 1- while develeoping the services, I will need the api gateway as an entrypoint to my services, I know that there is an api gateway service offered by AWS, but I can't use it while developing, so I have to use spring cloud gateway, and implement the routing by myself, and when coming to deploy the application, deploy also the apigateway from spring, and don't use the apigateway offered by AWS, or there is another way? 2- in prod, service discovery is provided by services in kubernetes, but how would I implement the service discovery in local to test things ?

1 Answer
0

When building a microservices application with Spring Boot and FastAPI, there are several approaches to handle the development vs. production environment differences:

For your API Gateway question: You have a few options to address the local vs. production API Gateway challenge:

  1. You can use Spring Cloud Gateway during development and continue using it in production. This provides consistency across environments and eliminates the need to switch between different gateway implementations.
  2. Alternatively, you could use a local proxy tool like Envoy or NGINX during development that mimics the behavior of AWS API Gateway, then switch to AWS API Gateway in production.

For service discovery:

  1. In local development, you can use tools that are compatible with both environments:
  • Spring Cloud's service discovery mechanisms (like Eureka)
  • A local Kubernetes cluster using tools like Minikube or Kind
  • Docker Compose with manual service configuration

The key is to minimize differences between environments. Using Kubernetes locally (through Minikube or Kind) can help maintain consistency with your production environment, allowing you to use the same service discovery mechanisms in both places.

Another approach is to adopt a hybrid deployment model where you use Amazon EKS for both environments, which would provide consistent container orchestration and service discovery mechanisms across development and production. This would allow you to leverage the same Kubernetes-based service discovery in both environments.

By choosing tools and approaches that work consistently across environments, you can reduce the friction between development and production deployments.
Sources
What is the different between ECS and EKS? | AWS re:Post
Re-architecting as microservices in Linux containers - AWS Prescriptive Guidance
Managed Kubernetes – Amazon Elastic Kubernetes Service (EKS) Hybrid Nodes - AWS

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.