Eat your own dog food: how AWS leverages Serverless

Tim Bray from Amazon gave a great talk at re:Invent 2018 where he shows us how AWS uses Serverless technologies. Did you know that some of the newer services such as API Gateway and EKS are using API Gateway and Lambda to implement the control plane? In this post, I summarise a few interesting points he made. I also encourage you to watch the full video.

SQS internals

SQS provides message queues as a service. The following figure shows a high-level architecture of the SQS service.

SQS internals

When a client make calls to the SQS API, you talk to the Front End service of SQS. The Front End service asks the Metadata service (backed by DynamoDB) for internal data about the queue. Does it exist? How does the queue policy look like? Which Back End cluster is responsible for the queue? Once the Front End knows the answers, it likely checks if the requestor is allowed to make the request and routes the request to one of the many Back End clusters to process the message. A single Back End cluster is responsible for one or many queues (or partitions of a queue) and stores your messages in a distributed manner on the cluster.

In the background, the Load Manager service continually checks the utilization of the Back End clusters. If a cluster gets hot, the queues are partitioned and/or moved to other/new clusters. If clusters idle, queues are moved as well to shut down whole clusters. As users of SQS, we don’t see any of this. We send and retrieve messages.

One funny anecdote Tim shares with us: the SQS team replaced an Oracle Database with DynamoDB.

Amazon MQ internals

Amazon MQ runs ActiveMQ brokers on your behalf. The following figure shows a high-level architecture of the ActiveMQ service.

Amazon MQ internals

The brokers itself run on EC2 Instances and likely persist your state on EBS volumes. Tim calls this the Data Plane. Interestingly, the Control Plane (e.g., the public API) is implemented using API Gateway and Lambda functions that store the state about the ActiveMQ clusters in DynamoDB.

AWS uses Serverless to implement control planes

Also, Tim talks about a few other services that come with Serverless control planes:

  • Amazon SageMaker
  • AWS Batch
  • AWS Elemental
  • AWS AppSync
  • AWS IoT Core
  • Amazon GuardDuty
  • Amazon EKS
  • Amazon API Gateway

Funny story: API Gateway itself uses a Serverless control plane.

Full video

I hope you are now interested in the full talk!



What’s your favorite talk from re:Invent? Let me know!

Published on


Subscribe now and we'll keep you posted about new content on our blog.

We are raffling our book AWS in Action among all newsletter subscribers.

Newsletter RSS Feedly
Michael Wittig

Michael Wittig

I’m the author of Amazon Web Services in Action. I work as a software engineer, and independent consultant focused on AWS and DevOps.

Is anything missing in my article? I'm looking forward to your feedback! @hellomichibye or michael@widdix.de.

marbot

Are you part of a highly motivated DevOps team? Use marbot, a friendly chatbot, to forward all kind of alerts from your AWS infrastructure to Slack. Alerts are escalated across your team automatically allowing you to focus on your daily work.

Amazon Web Services in Action (Second Edition)

Amazon Web Services in Action (Second Edition) introduces you to computing, storing, and networking in the AWS cloud.