Dive deep into Amazon DynamoDB (DAT406)

Building DynamoDB at Scale

Key Takeaways

  • DynamoDB is built to provide predictable low latency at any scale for applications
  • The architecture uses horizontal partitioning and replication to achieve this, with automatic scaling and high availability
  • The presentation covers three key aspects of the DynamoDB architecture:
    1. MemDS - an in-memory partition metadata store for fast lookup
    2. Warm Throughput - a feature to easily scale your table's capacity for spikes in traffic
    3. Strongly Consistent Global Tables - a new feature that provides global read-after-write consistency

MemDS - Partition Metadata Store

  • DynamoDB needs to efficiently locate data partitions for millions of requests per second
  • Using a traditional database for this metadata would not provide the required performance
  • MemDS is an in-memory, distributed database designed to handle this lookup efficiently
  • It uses versioning and eventually consistent updates from the storage nodes to maintain an accurate view of partition locations
  • This allows request routers to quickly determine where to forward requests without introducing unpredictable latency

Warm Throughput

  • Customers want to know how much traffic their DynamoDB tables can handle, especially for predictable spikes
  • The old approach of provisioning capacity was complex and could lead to issues during scaling
  • Warm Throughput allows setting a target throughput for a table or index, which DynamoDB will scale to meet
  • This is independent of provisioned or on-demand billing mode, providing flexibility
  • Warm Throughput can be set in advance of traffic spikes, ensuring the table is ready to handle the load

Strongly Consistent Global Tables

  • Previous global table feature provided asynchronous replication and last-writer-wins conflict resolution
  • New strongly consistent global tables use a multi-region log to guarantee global read-after-write consistency
  • Writes are first recorded in the log, then asynchronously replicated to the table replicas
  • Consistent reads use "heartbeats" to ensure they only return data that is fully replicated
  • This allows use cases requiring strong consistency, like generating global unique sequence numbers

Takeaways for Developers

  • Use hedging (sending duplicate requests) for predictable latency
  • Design systems for constant work load to maintain availability
  • Leverage eventual consistency where possible, but use synchronous caching carefully
  • Maintain long-lived connections to DynamoDB for better performance
  • Use the new Warm Throughput feature to scale for traffic spikes
  • Consider strongly consistent global tables when you require cross-region consistency guarantees

Your Digital Journey deserves a great story.

Build one with us.

Cookies Icon

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.

Talk to us