Service Discovery: An Amazon ECS Reference Architecture
aws.amazon.com
aws.amazon.com
I'm not seeing what this buys. Maybe I'm dense. Anyone care to help me understand the value here?
Looking at the code further, it looks like there are failsafe hardcoded DNS names, but otherwise the DNS names for an upstream service are delivered via an ENV variable. I don't get what's happening here that's magical.
I wish Amazon did more to improve their ELB offering:
1) A single ELB costs $18/mo, regardless of the number of backend hosts. This might be OK if you're using ELB to front HTTP traffic from users, but it's crazy expensive for internal service discovery.
If your app has 5 micro-services, that's $90/month just for having a basic mechanism to access your ECS services.
2) ELB requires all backend hosts to expose the same port for load balancing. You can't balance to the same EC2 instance on different ports.
3) As a consequence of (2), you can't have multiple containers on the same EC2 host behind a load balancer.
Many popular programming languages have a global interpreter lock; you usually have to spawn multiple processes to make use of more CPU cores. People do that with things like gunicorn inside the container or with multiple containers + a haproxy load balancing container. It would be so much easier if ELB did all this instead.
4) ELB doesn't support URL maps. (i.e. different sets of backend hosts for different URL paths) The Google Cloud Platform load balancer supports this, and it's a tremendously useful.
"""[...] without the need for “sidecar” containers or expensive code change."""
People use "sidecar" and "ambassador" containers precisely because ELB is lacking functionality. Improving ELB will go a long way towards making service discovery easier on AWS.
https://tech.iheart.com/load-balancing-services-using-consul...
The only limits I've seen for Route53 are the number of hosted zones (50 by default?) and I don't see why that would be an issue. You'd only need one zone per app environment (dev/qa/prod).
>All requests – Five requests per second per AWS account. If you submit more than five requests per second, Amazon Route 53 returns an HTTP 400 error (Bad request). The response header also includes a Code element with a value of Throttling and a Message element with a value of Rate exceeded.
Though the general AWS recommendation for API limits is implementing exponential backoff + jitter.
http://docs.aws.amazon.com/general/latest/gr/api-retries.htm...
I suppose you can take it a bit further by batching requests (says up to 100 changes per request) but that would complicate distributed apps where the requests aren't coming from one coordinator.