We're transitioning from a monolithic architecture to microservices on ECS and are looking for ways to streamline service-to-service communication. We've looked into various methods like environment variables for service URLs, internal ALBs, and custom discovery setups. Currently, we're testing out Service Connect with Cloud Map and find it quite promising due to its features like native DNS, IAM-based access control, health-aware routing, and eliminating the need for internal ALBs. I'm reaching out to see how others are managing service communication within ECS. Specifically, I'm curious about your experiences and insights regarding: 1. Your current service-to-service communication setups, 2. Any real-world applications of Service Connect or Cloud Map in production—what worked well? 3. Scenarios where Service Connect excelled or didn't meet expectations, and 4. Tips for implementing it across multiple services or teams. I'm keen on gathering practical lessons, especially for early-stage or scaling products. What patterns do you utilize and why?
2 Answers
I've been using ECS with Service Connect and Fargate containers. It's super easy to set up! Inter-service communication is just a matter of configuring the port mappings on the container tasks and making sure the VPC and security groups are set up right. Now, you can use the service name as a hostname for other services in the same Service Connect Namespace, and it works like magic. It's really simple!
Consider looking into replacing synchronous calls with an event-driven approach where possible. Instead of relying on HTTP calls—which can fail for a multitude of reasons—you could send messages to SNS topics or SQS queues and handle them with Lambdas or Fargate tasks. This can really improve reliability and decouple your services.
Those methods sound great for the asynchronous parts of an application!