Fact-checked by Grok 2 weeks ago

Amazon DynamoDB

Amazon DynamoDB is a fully managed, serverless database service provided by (AWS), designed to deliver single-digit millisecond performance at any scale for key-value and document data models. Launched in 2012, it addresses the limitations of traditional relational databases by eliminating the need for server provisioning, maintenance, or manual scaling, while supporting applications that require and low-latency access to data. DynamoDB's core components include tables, which are collections of items (analogous to rows in relational databases), and each item consists of attributes (key-value pairs that can include nested documents). It supports both key-value and document storage models, allowing flexible schema design without fixed structures or JOIN operations, and provides strongly consistent and eventually consistent read options along with transactions for multi-item operations. Performance is ensured through automatic partitioning and replication across multiple Availability Zones within an AWS Region, achieving 99.999% durability and a 99.99% availability (). Key benefits include seamless scalability to handle tables exceeding 200 terabytes or over 500,000 requests per second, with capacity modes that automatically adjust throughput without downtime. Security features encompass encryption at rest using AWS Key Management Service (KMS), fine-grained access control via AWS Identity and Access Management (IAM), and integration with AWS services like VPC endpoints for private connectivity. DynamoDB also offers built-in backups, , and global tables for multi-Region replication, making it suitable for mission-critical applications in sectors such as , , , and . Pricing is usage-based, with a free tier providing 25 gigabytes of storage and 200 million requests per month, enabling cost efficiency for varying workloads.

History

Origins and Development

The development of DynamoDB traces its roots to the internal challenges faced by in scaling its infrastructure during the mid-2000s. In 2004-2005, engineers identified limitations in traditional relational databases, which struggled with peak holiday traffic and required complex sharding to handle growing data volumes. This led to the creation of , an internal key-value storage system designed for and scalability to support core services such as shopping carts, session management, and product catalogs. Dynamo's design, detailed in a seminal 2007 paper presented at the SOSP conference, addressed critical challenges in distributed systems at massive scale. The system was engineered to manage tens of millions of customers across tens of thousands of servers without single points of failure, using techniques like for partitioning and replication across multiple data centers to ensure during disk failures, network partitions, or outages. It prioritized availability through an model, allowing tunable quorum levels for reads and writes while employing vector clocks for versioning and application-assisted , thus avoiding the downtime risks of in high-traffic environments. The project was led by a team of Amazon engineers, including , then Vice President of Amazon and co-author of the Dynamo paper, along with contributors like Swaminathan Sivasubramanian. Early prototypes of Dynamo were deployed internally in production to power Amazon's e-commerce operations, validating its reliability under real-world loads such as over three million daily checkouts during peak seasons. This internal adoption refined the system before its evolution into a managed cloud service, DynamoDB, to meet broader scalability demands.

Key Releases and Updates

Amazon DynamoDB was launched on January 18, 2012, as a fully managed database service on AWS, providing fast and predictable performance with seamless scalability. In 2017, AWS introduced several enhancements to improve flexibility and global availability, including to automatically adjust provisioned throughput across partitions and global tables on November 29 for multi-region, , enabling low-latency access to data across regions without manual intervention. The following year, on March 26, 2018, (PITR) was added, allowing continuous backups with per-second granularity for restoration up to 35 days prior, enhancing data protection capabilities. On November 28, 2018, capacity mode was released, eliminating the need for by automatically scaling throughput based on traffic and charging only for actual usage. Additionally, on November 27, 2018, transactions were introduced, providing compliance for up to 25 items initially (expanded to 100 in September 2022), supporting atomic operations across multiple items and tables. In June 2018, AWS established a 99.999% availability (SLA) for DynamoDB global tables, underscoring its high reliability for mission-critical applications. Support for , a SQL-compatible , was added in November 2020, simplifying data access for developers familiar with SQL while maintaining DynamoDB's performance. Post-2022 updates focused on cost optimization, integration, and advanced features. In November 2024, for on-demand throughput was reduced by 50%, and global tables costs dropped by up to 67%, making large-scale deployments more economical. Integration with Amazon Bedrock began in 2023, enabling serverless access to foundational models for generative applications, such as building context-aware chatbots that leverage DynamoDB for and data retrieval. In January 2025, configurable PITR periods were introduced, allowing users to set recovery windows from 1 to 35 days for more granular control over backup retention and costs. In June 2025, AWS launched multi-Region for DynamoDB global tables, enabling a recovery point objective (RPO) of zero to build highly resilient multi-Region applications. These updates, combined with ongoing commitments of 99.99% for standard tables and 99.999% for global tables, continue to evolve DynamoDB for modern, scalable workloads.

Core Concepts

Tables and Capacity Management

In Amazon DynamoDB, a serves as a collection of items, where each item represents a unique record without enforcing a fixed across all items; attributes and their data types can vary between items. DynamoDB distributes data across multiple partitions to achieve , using an internal applied to the partition key of each item to determine its storage partition, which helps ensure even data distribution and parallel processing. DynamoDB offers two capacity modes for managing throughput: provisioned mode, where users specify the desired read and write capacities in advance for predictable workloads, and on-demand mode, a serverless option that automatically scales to handle traffic variations without manual configuration, billing based on actual requests. In provisioned mode, capacity is measured in read capacity units (RCUs) and write capacity units (WCUs), where 1 RCU allows one strongly consistent read per second (or two eventually consistent reads) of up to 4 of , and 1 WCU permits one write per second of up to 1 of ; larger items consume multiple units proportionally. Throughput in DynamoDB is subject to limits, including a maximum of 3,000 RCUs and 1,000 WCUs per to prevent hotspots, with overall quotas enforced by AWS service limits; provisioned s support burst for short-term spikes up to 300 seconds using accumulated unused , and auto-scaling policies can dynamically adjust provisioned throughput based on utilization targets. Tables can be created through the AWS Management Console for a graphical , the AWS CLI for command-line , or various AWS SDKs for programmatic , typically requiring specification of the table name, , and capacity mode during initial setup. For example, using the AWS CLI in provisioned mode: aws dynamodb create-table --table-name MusicCollection --attribute-definitions AttributeName=Artist,AttributeType=S AttributeName=SongTitle,AttributeType=S --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5; in mode, replace the throughput parameter with --billing-mode PAY_PER_REQUEST.

Items, Attributes, and Keys

In Amazon DynamoDB, an item represents a single record within a table, analogous to a row in a , and consists of a collection of attributes that store the data. Each attribute is a fundamental defined as a name-value pair, where the value can be a scalar type (such as a or number), a set, or a type, allowing flexible storage of structured or semi-structured information. Items are uniquely identified by their , which ensures no duplicates within the table and serves as the basis for all data access operations. DynamoDB supports two types of primary keys to identify items: a simple primary key consisting solely of a key, or a composite primary key that combines a key with a sort key. The key, a scalar attribute (, number, or ), is hashed by DynamoDB to determine the for the item, enabling efficient distribution across the system's partitions. In a composite primary key, the sort key—an additional scalar attribute—organizes items with the same key value in sorted order, facilitating range queries and efficient retrieval of related data within a . Effective design is crucial for performance, emphasizing the selection of partition keys that promote even distribution of items and requests to prevent "hot partitions," where a single partition receives disproportionate traffic leading to throttling. For instance, using a as the sole partition key can cause skew if many writes occur simultaneously, concentrating load on few partitions; instead, high- attributes or composite keys with random suffixes are recommended to spread workload uniformly. Sort keys should be chosen to support common access patterns, such as by or , while maintaining the overall key's cardinality for balanced partitioning. Updates to item attributes are performed atomically, ensuring that operations like adding, modifying, or deleting attributes occur as a single, indivisible action without partial failures. The UpdateItem operation supports conditional expressions, which allow writes to succeed only if specified conditions are met—such as verifying an attribute's value for to prevent overwrites in concurrent scenarios. Each item in DynamoDB is limited to a maximum size of 400 , encompassing the binary lengths of both attribute names ( encoded) and attribute values, including any overhead from data types. This constraint applies uniformly to all operations, ensuring predictable storage and performance.

Supported Data Types

Amazon DynamoDB supports three main categories of data types: scalar types for simple values, set types for collections of unique scalar values, and document types for complex, nested structures. These types enable the storage of diverse data within item attributes, with all attributes in an item able to use any combination of supported types. Scalar types form the foundation for basic attribute values. The String (S) type stores Unicode UTF-8 encoded text, with a minimum length of 0 bytes for non-key attributes and a maximum of 400 KB per item. The Number (N) type accommodates positive, negative, or zero values up to 38 digits of precision, ranging from -9.9999999999999999999999999999999999999E+125 to 9.9999999999999999999999999999999999999E+125. Binary (B) handles arbitrary binary data, also up to 400 KB, often represented in base64 encoding. Boolean (BOOL) represents true or false values, while Null indicates an unknown or undefined state. Set types allow storage of unique, unordered collections of scalar values without duplicates. StringSet (SS) holds unique strings, NumberSet (NS) unique numbers, and BinarySet (BS) unique binary values, each constrained to the 400 KB item size limit and requiring at least one element. All elements in a set must share the same scalar type, and sets do not preserve insertion order. Document types facilitate hierarchical data structures resembling . List (L) provides an ordered collection of values, which can be scalars, sets, or other lists/, supporting nesting up to 32 levels deep. (M) stores unordered key-value pairs where keys are strings and values can be any supported type, also nestable up to 32 levels. These types enable flexible representations, such as nested maps for JSON-like objects; for instance, a might use a map like {"name": "Alice", "preferences": {"theme": "dark", "notifications": true}}. Key constraints apply across types to ensure performance and storage efficiency. The overall item size, including all attributes and overhead, cannot exceed 400 . While can directly hold primitive scalar values, homogeneous arrays of primitives are often modeled using of maps for more structured access, such as [{"value": 1}, {"value": 2}]. In PartiQL queries, DynamoDB handles type for operations like arithmetic on numbers or appending to , with implicit conversions where applicable, such as treating strings as numbers in expressions. These types integrate into item attributes to define the schema-less structure of DynamoDB tables.

Data Modeling and Access Patterns

Primary and Secondary Indexes

In Amazon DynamoDB, every includes a primary index that is implicitly created upon creation and is based on the table's , which consists of a partition and an optional sort . This primary enables efficient querying and scanning of using the designated attributes, serving as the foundational structure for organization and access within the . Secondary indexes extend the querying capabilities of DynamoDB by allowing alternative keys beyond the , without requiring full duplication of the table's data. They consist of a subset of attributes from the base table, including an alternate key, and support Query operations to enable diverse access patterns such as retrieving items by non-primary attributes. There are two types of secondary indexes: global secondary indexes (GSIs) and local secondary indexes (LSIs), each designed for specific use cases while adhering to DynamoDB's principles. Global secondary indexes (GSIs) provide flexibility by using a different partition and optional sort from the base , allowing queries on entirely new dimensions of the data. GSIs are created either during creation or added to existing tables via an update operation, during which DynamoDB performs backfilling to populate the with existing data, a process that can take time proportional to the 's size. They maintain separate provisioned read and write capacity from the base , enabling independent scaling for -specific workloads. Projections in GSIs determine which attributes are included: KEYS_ONLY (only and primary ), INCLUDE (keys plus specified non- attributes), or ALL (all attributes). When using the INCLUDE projection type, the total number of non- attributes across all secondary on a cannot exceed 100. By default, GSIs offer for reads; they are particularly useful for ad-hoc queries on attributes not covered by the primary , such as enabling access patterns in applications with multiple query requirements. Local secondary indexes (LSIs), in contrast, share the same key as the base but allow a different sort key, facilitating queries within the same using sorting criteria. LSIs must be defined at the time of creation and cannot be added or removed afterward, limiting their use to scenarios anticipated during initial design. They share the base 's read capacity units but consume write capacity from the during updates, and projections follow the same options as GSIs (KEYS_ONLY, INCLUDE, or ALL). When using the INCLUDE projection type, the total number of non-key attributes across all secondary indexes on a cannot exceed 100. A supports up to 5 LSIs, making them suitable for fine-grained within , such as querying by different timestamps or categories under the same key. DynamoDB imposes key limitations on indexes to ensure : a table can have up to 20 GSIs and 5 LSIs, with all secondary indexes requiring unique names and adhering to the same attribute naming rules as the base table. These constraints, combined with projection efficiencies like sparse indexes (where items without projected attributes are omitted), help maintain performance while supporting complex data models without full table replication.

Common Architectural Patterns

In Amazon DynamoDB, common architectural patterns revolve around optimizing for query efficiency in a environment by prioritizing access patterns and leveraging key structures to model relationships without traditional joins. is a foundational technique, where redundant data is intentionally duplicated across items to enable fast reads by co-locating related information, thereby avoiding the performance overhead of relational joins that DynamoDB does not natively support. This approach trades off increased —requiring updates to multiple items when source data changes—for reduced read latency and throughput costs, as a single query can retrieve complete datasets. A prevalent pattern is the single-table design, which consolidates multiple entity types into one DynamoDB table using composite primary keys to differentiate and access efficiently. By employing a partition key () for entity grouping and a sort key (SK) for ordering or hierarchy, this pattern enhances data locality, minimizes cross-table queries, and simplifies management while smoothing partition-level traffic. For one-to-many relationships, such as a user and their orders, the design uses the user's as the and a composite SK (e.g., "ORDER#" followed by or order ) to store child items adjacently, allowing selective queries via key condition expressions to retrieve related items without full scans. This enables efficient pagination and filtering, though it requires careful SK prefixing to avoid hot partitions. Many-to-many relationships are modeled using adjacency lists within the single-table paradigm, where items represent connections between entities via SKs listing related IDs, often augmented by global secondary indexes (GSIs) for reverse lookups. For instance, in a system linking to , the PK might be the invoice ID with an SK listing bill IDs; a GSI on the SK then supports queries for all invoices per bill, projecting only necessary attributes to control costs. The trade-off here is minimal duplication but potential need for additional processing, such as via and , to maintain consistency during updates. Access pattern prioritization drives these designs, starting with identification of core queries (e.g., retrieving orders by ) to inform key structures, ensuring partition keys distribute load evenly and sort keys support range queries. Anti-patterns include over-normalization, which fragments data across tables and forces inefficient scans or multiple requests, or embedding complex nested structures that inflate read capacity units (RCUs) without leveraging keys. Schema evolution is handled flexibly using map attributes to add fields without altering the table, mitigating rigidity in evolving applications. In an scenario, orders can be modeled with a PK as the order ID and an SK combining entity types (e.g., "ITEM#productId" for line items, "SHIP#timestamp" for shipments), enabling queries like fetching all products in an order via SK begins_with "ITEM#". A GSI on product ID and order date supports pattern like retrieving recent orders per product, demonstrating how composite keys align with business queries while denormalizing details like customer info into order items to avoid extra reads.

Operations

Queries and Scans

In Amazon DynamoDB, the primary read operations are Query and , which enable retrieval of items from tables or secondary indexes based on specified criteria. The Query operation is designed for efficient access to items using primary keys or index keys, while the operation performs a full read, making it suitable for scenarios without precise key-based filtering but generally less performant due to higher consumption. Both operations support optional filters, projections to limit returned attributes, and pagination for handling large result sets. The Query operation retrieves items from a or secondary index by specifying the partition attribute name and value, which identifies all items sharing that partition . Optionally, a sort condition can be applied using operators such as (EQ), less than or equal to (LE), less than (LT), greater than or equal to (GE), greater than (GT), begins_with, or between, allowing refinement of results within the partition. For example, a KeyConditionExpression might specify partition_key = :value AND sort_key BETWEEN :low AND :high to fetch a range of items. Queries can include a FilterExpression to further narrow results after the key-based retrieval, though filters do not reduce capacity consumption as they are applied post-query. The ProjectionExpression parameter allows selecting specific attributes to return, optimizing data transfer without affecting read capacity units (RCUs). Queries on global secondary indexes (GSIs) are eventually consistent only, while local secondary indexes (LSIs) and base s support both consistency models. In contrast, the operation examines every item in the entire or , returning all or a filtered subset without requiring key specifications, which makes it useful for analysis or when access patterns do not align with keys. A FilterExpression can be applied to exclude items post-scan, using conditions on non-key attributes, but this does not lower the RCUs consumed since the full scan occurs regardless. Like Query, Scan supports ProjectionExpression for attribute selection and a parameter to cap the number of items evaluated per request, with a maximum response size of 1 MB. Scans are less efficient than queries for targeted reads, as they can consume significant —equivalent to reading the entire table—especially in large tables, and are best reserved for infrequent operations or small datasets. scans can be enabled by specifying and TotalSegments parameters to distribute the workload across multiple workers. Both Query and Scan offer consistency options to balance data freshness and cost. Eventually consistent reads, the default, may reflect changes from recent writes after a brief propagation delay across replicas and consume 0.5 RCUs per 4 KB of data read. Strongly consistent reads, requested by setting ConsistentRead to true, guarantee the most recent data by querying a majority of replicas and double the RCU consumption to 1 RCU per 4 KB. Strongly consistent reads are unavailable for GSIs and streams but supported for tables and LSIs. Applications requiring immediate accuracy, such as financial systems, should use strongly consistent reads, while others can leverage for cost efficiency. Pagination is handled in both operations via the ExclusiveStartKey request parameter, which uses the LastEvaluatedKey from a previous response to resume from the next item, ensuring complete results across multiple requests without exceeding the 1 MB limit per call. The response includes for matching items and ScannedCount for evaluated items, helping assess efficiency—high ScannedCount relative to indicates potential for optimization via better indexing. Since 2020, DynamoDB has integrated PartiQL, a SQL-compatible query language that allows ad hoc, SQL-like statements across tables and indexes without needing to specify API operations directly. For instance, a SELECT statement like SELECT * FROM Table WHERE partition_key = ? performs a query equivalent, supporting joins, aggregations, and operations on multiple tables in a single request via the ExecuteStatement API. PartiQL simplifies development for users familiar with SQL while maintaining DynamoDB's performance characteristics, including the same consistency and capacity rules as native operations.

Locking and Consistency Models

Amazon DynamoDB employs two primary read consistency models: eventually consistent reads, which are the default and provide lower at the cost of potential staleness, and strongly consistent reads, which guarantee the most up-to-date data but consume double the read units. Eventually consistent reads reflect changes from all prior successful writes but may not immediately show the latest updates across s, while strongly consistent reads query the primary directly to ensure accuracy, applicable to primary key lookups in tables and local secondary indexes but not global secondary indexes or streams, which remain eventually consistent. For concurrency control, DynamoDB implements optimistic locking through conditional writes, where updates succeed only if specified attributes match expected values, often using a number attribute to detect conflicts. This approach avoids traditional locks by allowing concurrent reads and writes, with failures triggering retries; for instance, an application increments a field on each update and conditions the write on the current matching the expected one, preventing overwrites from out-of-date clients. Introduced in late , DynamoDB transactions provide atomicity and serializable for multi-item operations across up to 100 actions in one or more tables, using APIs such as TransactWriteItems for writes and TransactGetItems for reads. These operations execute as a single, all-or-nothing unit, ensuring that either all succeed or none do, with conflict detection via ; for example, TransactWriteItems supports Put, Update, Delete, and ConditionCheck actions, while TransactGetItems retrieves items atomically without consuming write capacity. Serializable prevents phenomena like dirty reads or lost updates, though transactions incur higher and capacity costs compared to individual operations. DynamoDB Streams capture an ordered sequence of item-level changes for a table, enabling applications to maintain consistency through event-driven processing, with integration to services like Data Streams for real-time data pipelines. Each stream record includes the modified item's before-and-after images, new or old values, and metadata such as sequence numbers and timestamps, stored for up to 24 hours to support reliable replay and deduplication. While streams provide for downstream applications—without built-in transactional guarantees—they facilitate use cases like cross-region synchronization or audit logging by triggering functions or streaming to for further processing. In global tables, which replicate data across multiple AWS Regions for multi-active availability, conflict resolution defaults to a last-writer-wins strategy based on internal timestamps, ensuring eventual consistency by propagating the most recent update to all replicas. If simultaneous writes occur to the same item from different Regions, DynamoDB resolves the conflict in favor of the write with the latest timestamp, discarding others to avoid divergence. As of June 30, 2025, global tables also support multi-Region strong consistency (MRSC), enabling applications to achieve strong consistency across regions with a zero recovery point objective (RPO) for enhanced resilience in mission-critical workloads. For custom resolution, applications can leverage DynamoDB Streams to implement application-level logic, such as merging changes or notifying users of conflicts, rather than relying solely on the default mechanism.

Performance and Limitations

Latency and Throughput Claims

Amazon DynamoDB is designed to deliver single-digit for read and write operations at any scale, enabling predictable for applications handling varying workloads. This is achieved through its fully managed, serverless that automatically scales resources without manual intervention. For instance, AWS highlights that DynamoDB maintains low even as tables grow to millions of items, with typical response times under 10 milliseconds for standard operations like GetItem and PutItem. Throughput in DynamoDB is measured in terms of Read Capacity Units (RCUs) and Write Capacity Units (WCUs), where one RCU supports one strongly consistent read per second for items up to 4 (or two eventually consistent reads), and one WCU supports one write per second for items up to 1 . The offers unlimited throughput scalability via automatic across multiple servers, allowing tables to handle millions of requests per second globally. Each supports a maximum of 3,000 RCUs per second for strongly consistent reads (or 6,000 for eventually consistent) and 1,000 WCUs per second. To manage traffic spikes, DynamoDB includes , which dynamically allocates additional throughput to individual partitions experiencing hot spots, preventing throttling and sustaining higher workloads without reconfiguration. AWS-provided benchmarks demonstrate DynamoDB's capability to achieve over 100,000 writes per second per table in provisioned mode, with mode supporting similar scales after a brief warming period to exceed 100,000 reads per second. New tables initially support up to 4,000 writes per second and 12,000 reads per second, scaling higher based on usage patterns. These results underscore the service's ability to support high-volume applications, such as or platforms, while maintaining consistent performance. Several factors can influence in DynamoDB, including network distance between the client and the AWS , item (larger items up to the 400 KB limit increase processing time), and the chosen consistency level. Strongly consistent reads, which query a of replicas for the most up-to-date , typically incur approximately twice the of eventually consistent reads due to the additional coordination required. Additionally, DynamoDB commits to a 99.99% monthly uptime () for standard tables, with service credits issued if availability falls below this threshold, ensuring high reliability alongside low . For global tables, the extends to 99.999% availability.

Known Limitations and Best Practices

Amazon DynamoDB imposes a maximum item size of 400 KB, which includes the lengths of attribute names and values in encoding. This constraint necessitates strategies like compressing data or offloading large attributes to with references stored in DynamoDB items. Additionally, DynamoDB does not support server-side joins, requiring applications to denormalize data or perform client-side processing for related data retrieval. Eventual consistency, the default read model, can lead to risks of reading stale data shortly after writes, though strongly consistent reads mitigate this at double the cost in read capacity units. Hot partitions occur when uneven key distribution causes throttling on specific partitions exceeding provisioned throughput, potentially impacting application performance. Scan operations are particularly costly, as they consume read capacity across the entire or , making them inefficient for large datasets compared to targeted queries. Over-provisioning capacity in provisioned mode leads to unnecessary expenses, while attribute names can be up to 64 KB in length, but partition keys, sort keys, and names of projected attributes in secondary indexes are limited to 255 bytes ( encoded); expression attribute names are limited to 255 bytes, which can complicate schema design if exceeded. DynamoDB lacks native support for cross-region queries without using global tables, which enable multi-region replication but introduce across replicas. To optimize usage, monitor tables using Amazon CloudWatch metrics for throughput, , and errors to detect issues like throttling early. As of August 2025, enhanced throttling observability includes ThrottlingReasons fields in exceptions and new CloudWatch metrics for detailed analysis of throttling events. Adopt single-table designs to minimize the number of tables, simplifying management and scaling while supporting multiple access patterns via secondary indexes. Implement in retry logic to handle transient errors like provisioned throughput exceeded, starting with short delays and increasing progressively. Design operations for idempotency, especially in transactions, to safely retry without duplicating effects, using unique identifiers or conditional writes. For scaling, ensure even distribution of partition keys to avoid hot partitions, and leverage global secondary indexes (GSIs) for scenarios where multiple query patterns are needed without overloading the base table. Integrate with services like for caching frequently accessed data, reducing read latency and costs in read-heavy workloads.

System Architecture

Underlying Data Structures

Amazon DynamoDB employs as the primary for storing items within each , enabling efficient ordering and retrieval based on partition keys and sort keys where applicable. This structure supports the database's key-value and document storage model by maintaining sorted data for range queries and point lookups, while write-ahead logs (WALs) append operations sequentially to ensure before applying changes to the B-tree. The use of B-trees, combined with WALs, optimizes for both read and write performance in a distributed environment, handling variable-length attributes through standard encodings like for strings and for binary data. Partitions in DynamoDB represent logical allocations of distributed across multiple storage nodes, with automatically sharded using a of the to achieve even distribution and . Each is backed by solid-state drives (SSDs) and can grow dynamically; when a approaches 10 in size or nears its throughput limits (3,000 read capacity units or 1,000 write capacity units per second), DynamoDB automatically splits it into two or more sub-partitions to maintain and balance load across nodes. This virtual partitioning allows seamless horizontal scaling without manual intervention, ensuring that queries can be routed efficiently to the relevant storage nodes. For replication, DynamoDB maintains three replicas per , distributed across multiple Availability Zones (AZs) within a to enhance and . Writes are coordinated using a Multi-Paxos consensus , requiring a of two out of three replicas to acknowledge the WAL entry before the operation succeeds. Strongly consistent reads are served from the leader replica to ensure the latest data. This quorum-based approach ensures that data remains consistent even in the face of node failures, with synchronous replication to the primary replicas followed by asynchronous propagation to others. DynamoDB achieves 99.999999999% (11 ) durability over a one-year period through a combination of synchronous replication across replicas and periodic archiving of WALs to , which itself provides high-durability . Continuous background processes, including checksums on data blocks, detect and repair silent corruption, while via continuous backups further bolsters resilience against . Internal handling of , such as for using structures like Perkle trees, optimizes efficiency for variable-length attributes without requiring user intervention.

Query Execution and Distribution

In Amazon DynamoDB, query requests are initially directed to a service endpoint, where a node determines the target partitions based on an internal applied to the partition key value. This hashing mechanism distributes data and requests across partitions using principles of , ensuring even load balancing and minimal data movement when partitions are added or removed. The then routes the request to the nodes owning the relevant partitions, which are replicated across multiple Availability Zones for . Query execution occurs in across the identified partitions to enhance throughput and reduce latency. For operations spanning multiple partitions, such as scans or queries with broad key conditions, DynamoDB divides the workload into subqueries or segments that are processed concurrently on partition-owning nodes. Results from these executions are merged at the coordinator or , often using techniques like stream flattening to combine datasets efficiently. To minimize data transfer, filter conditions are pushed down to the storage layer, allowing partitions to apply predicates early and return only qualifying items. Optimizations in query execution leverage secondary indexes to target specific directly, circumventing full scans that would otherwise consume excessive read capacity and increase . secondary indexes, for instance, enable efficient access to non-key attributes without scanning the entire , while secondary indexes support queries within a . about schemas and index structures is cached internally to accelerate and decisions, reducing overhead for repeated operations. Fault tolerance during query execution is achieved through retries on alternative replicas in the event of node failures and the use of quorum-based reads for data consistency. If a partition owner is unavailable, the coordinator redirects the request to another replica in the same partition, leveraging replication across three Availability Zones. Strongly consistent reads are served from the leader replica to ensure the latest committed data, while eventually consistent reads can be served from any replica for higher availability and lower latency. For global tables, which replicate data across multiple AWS Regions, query routing is typically client-driven or managed at the to select the nearest or lowest-latency replica. Clients can use latency-aware strategies, such as probing multiple regional endpoints or integrating with services like Amazon Route 53, to direct reads and writes to the optimal region while maintaining multi-active replication. As of June 2025, global tables support multi-Region , allowing applications to achieve strong consistency guarantees across regions. This approach ensures low-latency access and during regional outages without interrupting query execution.

References

  1. [1]
    What is Amazon DynamoDB? - Amazon DynamoDB
    Amazon DynamoDB is a serverless, NoSQL, fully managed database with single-digit millisecond performance at any scale.
  2. [2]
    Core components of Amazon DynamoDB - AWS Documentation
    In DynamoDB, tables, items, and attributes are the core components that you work with. A table is a collection of items, and each item is a collection of ...<|control11|><|separator|>
  3. [3]
    Amazon DynamoDB Service Level Agreement
    May 14, 2025 · AWS will use commercially reasonable efforts to make DynamoDB available with a Monthly Uptime Percentage for each AWS region, during any monthly billing cycle.Missing: timeline | Show results with:timeline
  4. [4]
    Amazon DynamoDB Pricing | NoSQL Key-Value Database
    The best way to calculate the monthly cost of DynamoDB is to utilize the AWS Pricing Calculator. This simple, interactive tool provides the ability to estimate ...On-Demand Capacity · Provisioned Capacity · Create and Query a NoSQL...
  5. [5]
    Amazon's DynamoDB — 10 years later
    One of Vogels's coauthors on the 2007 Dynamo paper, and a key contributor to the development of DynamoDB was Swaminathan (Swami) Sivasubramanian, then an Amazon ...
  6. [6]
    [PDF] Dynamo: Amazon's Highly Available Key-value Store
    This paper described Dynamo, a highly available and scalable data store, used for storing state of a number of core services of. Amazon.com's e-commerce ...
  7. [7]
    Amazon's Dynamo | All Things Distributed
    Oct 2, 2007 · Dynamo is internal technology developed at Amazon to address the need for an incrementally scalable, highly-available key-value storage system.Missing: launch | Show results with:launch
  8. [8]
    AWS Announces DynamoDB
    Jan 18, 2012 · We are excited to announce the immediate availability of Amazon DynamoDB, a fully managed NoSQL database service that provides extremely fast and predictable ...
  9. [9]
    AWS Launches Amazon DynamoDB Global Tables
    Nov 29, 2017 · Global Tables is available today in five regions: US East (Ohio), US East (N. Virginia), US West (Oregon), EU (Ireland, and EU (Frankfurt). To ...
  10. [10]
    New – Amazon DynamoDB Continuous Backups and Point-In-Time ...
    Mar 26, 2018 · DynamoDB can back up your data with per-second granularity and restore to any single second from the time PITR was enabled up to the prior 35 days.
  11. [11]
    Announcing Amazon DynamoDB On-Demand - AWS
    Nov 28, 2018 · Amazon DynamoDB on-demand is a flexible new capacity mode for DynamoDB capable of serving thousands of requests per second without capacity ...
  12. [12]
    New – Amazon DynamoDB Transactions | AWS News Blog
    Nov 27, 2018 · May 20, 2024: As of September 2022, DynamoDB now supports 100 items per transactions. March 13, 2020: Post updated to clarify how to use ...
  13. [13]
    Amazon DynamoDB highlights from the last 18 months you may ...
    Sep 26, 2018 · AWS designed DynamoDB with uptime in mind. As of June 2018, DynamoDB has a 99.999% uptime SLA. Read more about the DynamoDB SLA. DynamoDB ...Missing: timeline | Show results with:timeline<|control11|><|separator|>
  14. [14]
    Document history for DynamoDB
    The following table describes the important changes in each release of the DynamoDB Developer Guide from July 3, 2018 onward.
  15. [15]
    New – Amazon DynamoDB lowers pricing for on-demand ...
    Nov 14, 2024 · Effective November 1, 2024, DynamoDB has reduced prices for on-demand throughput by 50% and global tables by up to 67%, making it more cost-effective than ever.Missing: history | Show results with:history
  16. [16]
    Build generative AI agents with Amazon Bedrock, Amazon ...
    Dec 22, 2023 · In this post, we demonstrate how to build a generative AI financial services agent powered by Amazon Bedrock.Agent Architecture · Deployment · Testing And Validation
  17. [17]
    DynamoDB encryption at rest - AWS Documentation
    DynamoDB encryption at rest provides enhanced security by encrypting all your data at rest using encryption keys stored in AWS Key Management Service (AWS KMS).
  18. [18]
    Best practices for designing and using partition keys effectively in ...
    Every partition in a DynamoDB table is designed to deliver a maximum capacity of 3,000 read units per second and 1,000 write units per second. One read unit ...
  19. [19]
    DynamoDB throughput capacity - AWS Documentation
    DynamoDB has two throughput modes: on-demand, which is serverless and pay-per-request, and provisioned, where you specify and pay for hourly capacity.
  20. [20]
    DynamoDB on-demand capacity mode - AWS Documentation
    DynamoDB tables using on-demand capacity mode automatically adapt to your application's traffic volume. New on-demand tables will be able to sustain up to 4,000 ...
  21. [21]
    DynamoDB provisioned capacity mode - AWS Documentation
    Use DynamoDB provisioned capacity mode to specify the desired read and write throughput capacities when you create a table and enable capacity planning.
  22. [22]
    Getting started with DynamoDB - AWS Documentation
    Use these hands-on tutorials to get started with Amazon DynamoDB. Learn how to create tables, perform CRUD operations, and then query and scan data.
  23. [23]
    Working with items and attributes in DynamoDB - AWS Documentation
    In Amazon DynamoDB, an item is a collection of attributes. Each attribute has a name and a value. An attribute value can be a scalar, a set, or a document type.Reading an item · Writing an item · Return values · Batch operations
  24. [24]
    Partitions and data distribution in DynamoDB - AWS Documentation
    DynamoDB tables store items containing attributes uniquely identified by primary keys. DynamoDB supports partition keys, partition and sort keys, and secondary ...
  25. [25]
    Best practices for using sort keys to organize data in DynamoDB
    In an Amazon DynamoDB table, the primary key that uniquely identifies each item in the table can be composed of a partition key and a sort key. Well-designed ...
  26. [26]
    Designing partition keys to distribute your workload in DynamoDB
    A partition key design that doesn't distribute I/O requests effectively can create "hot" partitions that result in throttling and use your provisioned I/O ...Missing: principles | Show results with:principles
  27. [27]
    Constraints in Amazon DynamoDB - AWS Documentation
    The maximum item size in DynamoDB is 400 KB, which includes both attribute name binary length (UTF-8 length) and attribute value lengths (again binary length).
  28. [28]
    Best practices for storing large items and attributes in DynamoDB
    Amazon DynamoDB limits the size of each item that you store in a table to 400 KB (see Quotas in Amazon DynamoDB). If your application needs to store more ...
  29. [29]
    Supported data types and naming rules in Amazon DynamoDB
    DynamoDB tables store items containing attributes uniquely identified by primary keys. DynamoDB supports partition keys, partition and sort keys, and secondary ...
  30. [30]
    PartiQL data types for DynamoDB - AWS Documentation
    Explore the supported data types, with examples of each, for the DynamoDB implementation of the PartiQL query language.
  31. [31]
    Improving data access with secondary indexes in DynamoDB
    The primary key of a global secondary index can be either simple (partition key) or composite (partition key and sort key). The primary key of a local ...
  32. [32]
    Using Global Secondary Indexes in DynamoDB - AWS Documentation
    Use global secondary indexes to perform alternate queries from the base DynamoDB table to model your application's various access patterns.
  33. [33]
    Local secondary indexes - Amazon DynamoDB - AWS Documentation
    Learn how to use local secondary indexes to efficiently query table data using alternate sort keys. Query data using multiple attributes with the same ...Scenario: Using a Local... · Reading data from a Local... · Provisioned throughput...
  34. [34]
    General guidelines for secondary indexes in DynamoDB
    Each table in DynamoDB can have up to 20 global secondary indexes (default quota) and 5 local secondary indexes. Global secondary indexes are often more useful ...
  35. [35]
    Take advantage of sparse indexes - Amazon DynamoDB
    DynamoDB global secondary indexes enable efficient queries on non-key attributes. Create tables with indexes, add indexes to existing tables, describe indexes, ...<|control11|><|separator|>
  36. [36]
    NoSQL design for DynamoDB - AWS Documentation
    NoSQL database systems like Amazon DynamoDB use alternative models for data management, such as key-value pairs or document storage.
  37. [37]
    Should Your DynamoDB Table Be Normalized or Denormalized?
    Dec 5, 2016 · When you denormalize data, you only need to query sections of your table, which scales to millions of requests unlike a tightly woven relational ...
  38. [38]
    Data Modeling foundations in DynamoDB - AWS Documentation
    DynamoDB tables store items containing attributes uniquely identified by primary keys. DynamoDB supports partition keys, partition and sort keys, and secondary ...
  39. [39]
    Data modeling building blocks in DynamoDB - AWS Documentation
    Explore the key building blocks for effective data modeling in DynamoDB, including composite sort keys, multi-tenancy, sparse indexes, time to live, ...
  40. [40]
    Best practices for managing many-to-many relationships in ...
    Adjacency lists are a design pattern that is useful for modeling many-to-many relationships in Amazon DynamoDB.
  41. [41]
    Using DynamoDB as a data store for an online shop
    Learn how to design a DynamoDB schema for an online shop, including use cases, access patterns, and a step-by-step approach to achieve the required access ...
  42. [42]
    Querying tables in DynamoDB - AWS Documentation
    DynamoDB global secondary indexes enable efficient queries on non-key attributes. Key concepts include creating, querying, projecting attributes, updating, ...
  43. [43]
    Scanning tables in DynamoDB - Amazon DynamoDB
    ### Summary of Scan Operation in Amazon DynamoDB
  44. [44]
    Query - Amazon DynamoDB - AWS Documentation
    The Query operation will return all of the items from the table or index with that partition key value. You can optionally narrow the scope of the Query ...Request Syntax · Request Parameters · Response Elements · Errors
  45. [45]
    None
    Nothing is retrieved...<|separator|>
  46. [46]
    DynamoDB read consistency - AWS Documentation
    Both tables and LSIs provide two read consistency options: eventually consistent (default) and strongly consistent reads. All reads from GSIs and streams are ...
  47. [47]
    DynamoDB read and write operations - AWS Documentation
    Using DynamoDB write operations, you can insert, update, or delete items in a table. This topic explains capacity unit consumption for these two operations.
  48. [48]
    Getting started with PartiQL for DynamoDB - AWS Documentation
    This section describes how to use PartiQL for DynamoDB from the Amazon DynamoDB console, the AWS Command Line Interface (AWS CLI), and DynamoDB APIs.
  49. [49]
    PartiQL select statements for DynamoDB - AWS Documentation
    Use the SELECT statement to retrieve data from a table in Amazon DynamoDB. Using the SELECT statement can result in a full table scan.
  50. [50]
    DynamoDB and optimistic locking with version number
    Optimistic locking is a strategy to ensure that the client-side item that you are updating (or deleting) is the same as the item in Amazon DynamoDB.
  51. [51]
    Best practices for implementing version control in DynamoDB
    Implement item version control in DynamoDB using optimistic locking to manage concurrent writes and ensure data integrity in distributed systems.
  52. [52]
    Amazon DynamoDB Transactions: How it works
    When an item size becomes too large (larger than 400 KB), or a local secondary index (LSI) becomes too large, or a similar validation error occurs because ...
  53. [53]
    TransactWriteItems - Amazon DynamoDB - AWS Documentation
    TransactWriteItems is a synchronous write operation that groups up to 100 action requests. These actions can target items in different tables.
  54. [54]
    TransactGetItems - Amazon DynamoDB - AWS Documentation
    TransactGetItems is a synchronous operation that atomically retrieves multiple items from one or more tables (but not from indexes) in a single account and ...
  55. [55]
    Change data capture for DynamoDB Streams - AWS Documentation
    DynamoDB Streams captures a time-ordered sequence of item-level modifications in any DynamoDB table and stores this information in a log for up to 24 hours.AWS Lambda triggers · Java example · IAM policy to allow an AWS...
  56. [56]
    DynamoDB Streams Use Cases and Design Patterns - Amazon AWS
    Jul 10, 2017 · This post describes some common use cases you might encounter, along with their design options and solutions, when migrating data from relational data stores ...
  57. [57]
    Global tables: How it works - Amazon DynamoDB
    Conflicts can arise if applications update the same item in different Regions at about the same time. To help ensure eventual consistency, DynamoDB global ...Global table concepts for... · Common tasks · Streams and transactions with...
  58. [58]
    Amazon DynamoDB Global Tables - AWS
    If the same item is modified in multiple Regions, DynamoDB will resolve the conflict by using a last-writer-wins resolution method.
  59. [59]
    Build resilient applications with Amazon DynamoDB global tables
    Oct 18, 2022 · Conflict resolution – If two writes occur to the same item from different Regions, DynamoDB reconciles that conflict in favor of the last writer ...
  60. [60]
    Understanding Amazon DynamoDB latency | AWS Database Blog
    Apr 12, 2023 · In this post, I dive deep into DynamoDB latency and techniques you can use to handle higher than normal latency when working with your DynamoDB backed ...
  61. [61]
    DynamoDB burst and adaptive capacity - AWS Documentation
    DynamoDB adaptive capacity responds by increasing the capacity of partition 4 so that it can sustain the higher workload of 150 WCU/sec without being throttled.
  62. [62]
    Demystifying Amazon DynamoDB on-demand capacity mode
    Mar 10, 2025 · For example, if your previous peak was 50,000 reads per second, DynamoDB instantly handles up to 100,000 reads per second. Once you sustain that ...Examining Cost-Related... · Performance And Scaling... · Operational MythsMissing: benchmarks | Show results with:benchmarks
  63. [63]
    Troubleshooting latency issues in Amazon DynamoDB
    To learn more about overall latency for calls from your client to the DynamoDB service, you can enable latency metric logging in your AWS SDK. Note. For most ...
  64. [64]
    Differences between a relational (SQL) database and DynamoDB ...
    DynamoDB is a non-relational NoSQL database that does not support table joins. Instead, applications read data from one table at a time.Missing: side | Show results with:side
  65. [65]
    Best practices for querying and scanning data in DynamoDB
    This section covers some best practices for using Query and Scan operations in Amazon DynamoDB. Performance considerations for scans.
  66. [66]
    AttributeDefinition - Amazon DynamoDB - AWS Documentation
    AttributeName. A name for the attribute. Type: String. Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes. AttributeType.
  67. [67]
    Global tables - multi-active, multi-Region replication
    Global tables automatically replicate your DynamoDB table ... Eliminate update conflict resolution so you can focus on your application's business logic.
  68. [68]
    Monitoring metrics in DynamoDB with Amazon CloudWatch
    You can monitor DynamoDB using CloudWatch, which collects and processes raw data from DynamoDB into readable, near real-time metrics.
  69. [69]
    Error handling with DynamoDB - AWS Documentation
    The concept behind exponential backoff is to use progressively longer waits between retries for consecutive error responses. For example, up to 50 milliseconds ...Error components · Error messages and codes · Error retries and exponential...
  70. [70]
    Latency reduction of hybrid architectures with Amazon ElastiCache
    Mar 12, 2018 · This blog post illustrates one of them: how to use caching to reduce latency, increase performance, and improve fault tolerance at the same time.Some Background On... · Setting Up An Amazon Ec2... · Deploying A Full Environment...
  71. [71]
    Single-table vs. multi-table design in Amazon DynamoDB
    Aug 16, 2022 · In this post, we'll talk about single-table design in DynamoDB. We'll start off with some relevant background on DynamoDB that will inform the data modeling ...
  72. [72]
    [PDF] Amazon DynamoDB: A Scalable, Predictably Performant ... - USENIX
    Jul 11, 2022 · Dynamo was created in response to the need for a highly scalable, available, and durable key-value database for shopping cart data.
  73. [73]
    Scaling DynamoDB: How partitions, hot keys, and split for heat ...
    Jan 30, 2023 · A partition gets close to 10 GB in size. A partition receives read or write traffic near its throughput capacity limit. Partitions today are ...Scaling Dynamodb: How... · Partitions · Split For Heat
  74. [74]
    Use parallelism to optimize querying large amounts of data in ...
    Apr 4, 2022 · I discussed the DynamoDB query system and the ways to split queries into multiple subqueries that can be run independently and in parallel.
  75. [75]
  76. [76]
    Routing strategies in DynamoDB - AWS Documentation
    The global table provides each stack in the various Regions with a local copy of the same data. You might consider designing for a single stack in a single ...Client-driven · Compute-layer routing · Route 53 routing