Amazon route53 service discovery with autonaming

This is a short demo of service discovery with R53 autonaming API using HTTP and DNS protocols

Let's imagine a bakery with 3 microservices hosted on various choices of compute stack - like API Gateway & Lambda, Containers on ECS or EKS, and traditional EC2 instance. We can have all of these services in their own autoscaling groups so they respond to changing loads.

Containers on ECS: As our tasks scale up and down in response to each compute stack uses its own mechanism for scaling. For example, the load on ECS is able to use Amazon Route 53 to add and remove DNS records for each task.

Example microservice: Cake crusts

Serverless using APIGateway and lambda: API gateway endpoint dynamically launches lambdas in response to the requests it receives. In our example, frosting microservice runs on lambda; The queries to Route53 are using service discovery over HTTP protocol.

Example microservice: Frosting

EC2 Compute: EC2 compute endpoint is used by "database as a service" where all our available choices are stored as a static list in table. In a real world example, you would have these values served by database as users make requests for data.

Example microservice: Database as a service

You can find more details on service discovery in the blog post and in the code.


These are the services I found, if you refresh the page the IPs or URLS of the workers should change:

  • Services details:

  • {% for service in services %} {% if service.text %}
  • endpoint: {{service.text|safe}}

  • {% endif%} {% if service.InstanceName %}
  • instance name:{{service.InstanceName|safe}}

  • {% endif%} {% endfor %}
architecture diagram