Strategies to reduce the API's latency

There are many strategies to reduce latency. We will look at two, both of which are set in the SAM template:

  • Increasing the Lambda RAM size: Currently, it is set to the minimum of 128 MB
  • Increasing the DynamoDB Read Capacity: Currently, it is set to the smallest value of 1 unit
What I really like about DynamoDB is that you can change the capacity per table, and change the write capacity independently of the read capacity. This is very interesting and cost-effective for me in read-heavy use cases, where I can set the read capacity higher than the write capacity. There are even options to have the table autoscale based on the read/write utilization, or have the capacity purely based on demand, where ...

Get Building Serverless Microservices in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.