Amazon DynamoDB
Amazon DynamoDB is a fully managed, serverless NoSQL database service provided by Amazon Web Services (AWS), designed to deliver single-digit millisecond performance at any scale for key-value and document data models.[1] 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 high availability and low-latency access to data.[1] 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).[2] 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 ACID transactions for multi-item operations.[1][3] 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 service level agreement (SLA).[4] Key benefits include seamless scalability to handle tables exceeding 200 terabytes or over 500,000 requests per second, with on-demand capacity modes that automatically adjust throughput without downtime.[1] 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.[1] DynamoDB also offers built-in backups, point-in-time recovery, and global tables for multi-Region replication, making it suitable for mission-critical applications in sectors such as gaming, e-commerce, IoT, and financial services.[1] 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.[5]History
Origins and Development
The development of Amazon DynamoDB traces its roots to the internal challenges faced by Amazon in scaling its e-commerce infrastructure during the mid-2000s. In 2004-2005, Amazon 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 Dynamo, an internal key-value storage system designed for high availability and scalability to support core services such as shopping carts, session management, and product catalogs.[6][7] 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 consistent hashing for partitioning and replication across multiple data centers to ensure fault tolerance during disk failures, network partitions, or outages. It prioritized availability through an eventual consistency model, allowing tunable quorum levels for reads and writes while employing vector clocks for versioning and application-assisted conflict resolution, thus avoiding the downtime risks of strong consistency in high-traffic environments.[7][8] The project was led by a team of Amazon engineers, including Werner Vogels, 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.[6][7][8]Key Releases and Updates
Amazon DynamoDB was launched on January 18, 2012, as a fully managed NoSQL database service on AWS, providing fast and predictable performance with seamless scalability.[9] In 2017, AWS introduced several enhancements to improve flexibility and global availability, including adaptive capacity to automatically adjust provisioned throughput across partitions and global tables on November 29 for multi-region, multi-master replication, enabling low-latency access to data across regions without manual intervention.[10] The following year, on March 26, 2018, point-in-time recovery (PITR) was added, allowing continuous backups with per-second granularity for restoration up to 35 days prior, enhancing data protection capabilities.[11] On November 28, 2018, on-demand capacity mode was released, eliminating the need for capacity planning by automatically scaling throughput based on traffic and charging only for actual usage.[12] Additionally, on November 27, 2018, transactions were introduced, providing ACID compliance for up to 25 items initially (expanded to 100 in September 2022), supporting atomic operations across multiple items and tables.[13] In June 2018, AWS established a 99.999% availability Service Level Agreement (SLA) for DynamoDB global tables, underscoring its high reliability for mission-critical applications.[14] Support for PartiQL, a SQL-compatible query language, was added in November 2020, simplifying data access for developers familiar with SQL while maintaining DynamoDB's performance.[15] Post-2022 updates focused on cost optimization, AI integration, and advanced features. In November 2024, pricing for on-demand throughput was reduced by 50%, and global tables costs dropped by up to 67%, making large-scale deployments more economical.[16] Integration with Amazon Bedrock began in 2023, enabling serverless access to foundational models for generative AI applications, such as building context-aware chatbots that leverage DynamoDB for persistent memory and data retrieval.[17] 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.[18] In June 2025, AWS launched multi-Region strong consistency for DynamoDB global tables, enabling a recovery point objective (RPO) of zero to build highly resilient multi-Region applications.[19] These updates, combined with ongoing SLA commitments of 99.99% for standard tables and 99.999% for global tables, continue to evolve DynamoDB for modern, scalable workloads.[4]Core Concepts
Tables and Capacity Management
In Amazon DynamoDB, a table serves as a collection of items, where each item represents a unique record without enforcing a fixed schema across all items; attributes and their data types can vary between items.[2] DynamoDB distributes data across multiple partitions to achieve scalability, using an internal hash function applied to the partition key of each item to determine its storage partition, which helps ensure even data distribution and parallel processing.[2][20] 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.[21][22] 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 KB of data, and 1 WCU permits one write per second of up to 1 KB of data; larger items consume multiple units proportionally.[23][20] Throughput in DynamoDB is subject to limits, including a maximum of 3,000 RCUs and 1,000 WCUs per partition to prevent hotspots, with overall table quotas enforced by AWS service limits; provisioned tables support burst capacity for short-term spikes up to 300 seconds using accumulated unused capacity, and auto-scaling policies can dynamically adjust provisioned throughput based on utilization targets.[20][21][23] Tables can be created through the AWS Management Console for a graphical interface, the AWS CLI for command-line automation, or various AWS SDKs for programmatic integration, typically requiring specification of the table name, primary key schema, and capacity mode during initial setup.[24] 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 on-demand mode, replace the throughput parameter with --billing-mode PAY_PER_REQUEST.[24][22]
Items, Attributes, and Keys
In Amazon DynamoDB, an item represents a single record within a table, analogous to a row in a relational database, and consists of a collection of attributes that store the data.[2] Each attribute is a fundamental data element defined as a name-value pair, where the value can be a scalar type (such as a string or number), a set, or a document type, allowing flexible storage of structured or semi-structured information.[25] Items are uniquely identified by their primary key, which ensures no duplicates within the table and serves as the basis for all data access operations.[2] DynamoDB supports two types of primary keys to identify items: a simple primary key consisting solely of a partition key, or a composite primary key that combines a partition key with a sort key.[20] The partition key, a scalar attribute (string, number, or binary), is hashed by DynamoDB to determine the storage partition for the item, enabling efficient distribution across the system's partitions.[26] In a composite primary key, the sort key—an additional scalar attribute—organizes items with the same partition key value in sorted order, facilitating range queries and efficient retrieval of related data within a partition.[27] Effective primary key 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.[28] For instance, using a timestamp as the sole partition key can cause skew if many writes occur simultaneously, concentrating load on few partitions; instead, high-cardinality attributes or composite keys with random suffixes are recommended to spread workload uniformly.[20] Sort keys should be chosen to support common access patterns, such as sorting by date or status, while maintaining the overall key's cardinality for balanced partitioning.[27] 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.[25] TheUpdateItem operation supports conditional expressions, which allow writes to succeed only if specified conditions are met—such as verifying an attribute's value for optimistic concurrency control to prevent overwrites in concurrent scenarios.[25]
Each item in DynamoDB is limited to a maximum size of 400 KB, encompassing the binary lengths of both attribute names (UTF-8 encoded) and attribute values, including any overhead from data types.[29] This constraint applies uniformly to all operations, ensuring predictable storage and performance.[30]
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.[31] 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.[31] 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.[31] Binary (B) handles arbitrary binary data, also up to 400 KB, often represented in base64 encoding.[31] Boolean (BOOL) represents true or false values, while Null indicates an unknown or undefined state.[31] 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.[31] All elements in a set must share the same scalar type, and sets do not preserve insertion order.[31] Document types facilitate hierarchical data structures resembling JSON. List (L) provides an ordered collection of values, which can be scalars, sets, or other lists/maps, supporting nesting up to 32 levels deep.[31] Map (M) stores unordered key-value pairs where keys are strings and values can be any supported type, also nestable up to 32 levels.[31] These types enable flexible representations, such as nested maps for JSON-like objects; for instance, a user profile might use a map like{"name": "Alice", "preferences": {"theme": "dark", "notifications": true}}.[31]
Key constraints apply across types to ensure performance and storage efficiency. The overall item size, including all attributes and overhead, cannot exceed 400 KB.[31] While lists can directly hold primitive scalar values, homogeneous arrays of primitives are often modeled using lists of maps for more structured access, such as [{"value": 1}, {"value": 2}].[31] In PartiQL queries, DynamoDB handles type compatibility for operations like arithmetic on numbers or appending to lists, with implicit conversions where applicable, such as treating strings as numbers in expressions.[32] These types integrate into item attributes to define the schema-less structure of DynamoDB tables.[31]
Data Modeling and Access Patterns
Primary and Secondary Indexes
In Amazon DynamoDB, every table includes a primary index that is implicitly created upon table creation and is based on the table's primary key, which consists of a partition key and an optional sort key.[2] This primary index enables efficient querying and scanning of data using the designated key attributes, serving as the foundational structure for data organization and access within the table.[2] Secondary indexes extend the querying capabilities of DynamoDB by allowing alternative keys beyond the primary key, without requiring full duplication of the table's data.[33] 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.[33] 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 NoSQL principles.[33] Global secondary indexes (GSIs) provide flexibility by using a different partition key and optional sort key from the base table, allowing queries on entirely new dimensions of the data.[34] GSIs are created either during table creation or added to existing tables via an update operation, during which DynamoDB performs backfilling to populate the index with existing data, a process that can take time proportional to the table's size.[34] They maintain separate provisioned read and write capacity from the base table, enabling independent scaling for index-specific workloads.[34] Projections in GSIs determine which attributes are included: KEYS_ONLY (only index and primary keys), INCLUDE (keys plus specified non-key attributes), or ALL (all table attributes). When using the INCLUDE projection type, the total number of non-key attributes across all secondary indexes on a table cannot exceed 100.[35] By default, GSIs offer eventual consistency for reads; they are particularly useful for ad-hoc queries on attributes not covered by the primary key, such as enabling access patterns in applications with multiple query requirements.[34] Local secondary indexes (LSIs), in contrast, share the same partition key as the base table but allow a different sort key, facilitating queries within the same partition using alternative sorting criteria.[36] LSIs must be defined at the time of table creation and cannot be added or removed afterward, limiting their use to scenarios anticipated during initial design.[33] They share the base table's read capacity units but consume write capacity from the table 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 table cannot exceed 100.[35] A table supports up to 5 LSIs, making them suitable for fine-grained access within partitions, such as querying by different timestamps or categories under the same partition key.[37] DynamoDB imposes key limitations on indexes to ensure scalability: 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.[37] 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.[38]Common Architectural Patterns
In Amazon DynamoDB, common architectural patterns revolve around optimizing for query efficiency in a NoSQL environment by prioritizing access patterns and leveraging key structures to model relationships without traditional joins.[39] Denormalization 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.[40] This approach trades off increased write amplification—requiring updates to multiple items when source data changes—for reduced read latency and throughput costs, as a single query can retrieve complete datasets.[40] 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 data efficiently.[41] By employing a partition key (PK) for entity grouping and a sort key (SK) for ordering or hierarchy, this pattern enhances data locality, minimizes cross-table queries, and simplifies table management while smoothing partition-level traffic.[41] For one-to-many relationships, such as a user and their orders, the design uses the user's ID as the PK and a composite SK (e.g., "ORDER#" followed by timestamp or order ID) to store child items adjacently, allowing selective queries via key condition expressions to retrieve related items without full scans.[42] 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.[43] For instance, in a system linking invoices to bills, 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.[43] The trade-off here is minimal duplication but potential need for additional processing, such as via DynamoDB Streams and AWS Lambda, to maintain consistency during updates.[43] Access pattern prioritization drives these designs, starting with identification of core queries (e.g., retrieving user orders by timestamp) to inform key structures, ensuring partition keys distribute load evenly and sort keys support range queries.[39] 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.[41] Schema evolution is handled flexibly using map attributes to add fields without altering the table, mitigating rigidity in evolving applications.[42] In an e-commerce 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 viaSK begins_with "ITEM#".[44] 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.[44]
Operations
Queries and Scans
In Amazon DynamoDB, the primary read operations are Query and Scan, 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 Scan operation performs a full table read, making it suitable for scenarios without precise key-based filtering but generally less performant due to higher capacity consumption. Both operations support optional filters, projections to limit returned attributes, and pagination for handling large result sets.[45][46] The Query operation retrieves items from a table or secondary index by specifying the partition key attribute name and value, which identifies all items sharing that partition key. Optionally, a sort key condition can be applied using operators such as equals (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 specifypartition_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 tables support both consistency models.[47][45]
In contrast, the Scan operation examines every item in the entire table or index, returning all or a filtered subset without requiring key specifications, which makes it useful for ad hoc 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 Limit 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 capacity—equivalent to reading the entire table—especially in large tables, and are best reserved for infrequent operations or small datasets. Parallel scans can be enabled by specifying Segment and TotalSegments parameters to distribute the workload across multiple workers.[48][46]
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 eventual consistency for cost efficiency.[3][49]
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 Count for matching items and ScannedCount for evaluated items, helping assess efficiency—high ScannedCount relative to Count indicates potential for optimization via better indexing.[47][48]
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.[50][51]
Locking and Consistency Models
Amazon DynamoDB employs two primary read consistency models: eventually consistent reads, which are the default and provide lower latency at the cost of potential staleness, and strongly consistent reads, which guarantee the most up-to-date data but consume double the read capacity units.[3] Eventually consistent reads reflect changes from all prior successful writes but may not immediately show the latest updates across replicas, while strongly consistent reads query the primary replica 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.[3] For concurrency control, DynamoDB implements optimistic locking through conditional writes, where updates succeed only if specified attributes match expected values, often using a version number attribute to detect conflicts.[52] This approach avoids traditional locks by allowing concurrent reads and writes, with failures triggering retries; for instance, an application increments a version field on each update and conditions the write on the current version matching the expected one, preventing overwrites from out-of-date clients.[52][53] Introduced in late 2018, DynamoDB transactions provide atomicity and serializable isolation 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.[54] These operations execute as a single, all-or-nothing unit, ensuring that either all succeed or none do, with conflict detection via optimistic concurrency control; for example, TransactWriteItems supports Put, Update, Delete, and ConditionCheck actions, while TransactGetItems retrieves items atomically without consuming write capacity.[55][56] Serializable isolation prevents phenomena like dirty reads or lost updates, though transactions incur higher latency and capacity costs compared to individual operations.[54] 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 Amazon Kinesis Data Streams for real-time data pipelines.[57] 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.[57] While streams provide eventual consistency for downstream applications—without built-in transactional guarantees—they facilitate use cases like cross-region synchronization or audit logging by triggering AWS Lambda functions or streaming to Kinesis for further processing.[58] 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.[59][60] 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.[61] 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.[62][63]Performance and Limitations
Latency and Throughput Claims
Amazon DynamoDB is designed to deliver single-digit millisecond latency for read and write operations at any scale, enabling predictable performance for applications handling varying workloads. This performance is achieved through its fully managed, serverless architecture that automatically scales resources without manual intervention. For instance, AWS documentation highlights that DynamoDB maintains low latency even as tables grow to millions of items, with typical response times under 10 milliseconds for standard operations like GetItem and PutItem.[1][64] 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 KB (or two eventually consistent reads), and one WCU supports one write per second for items up to 1 KB. The system offers unlimited throughput scalability via automatic data partitioning across multiple servers, allowing tables to handle millions of requests per second globally. Each partition 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 adaptive capacity, which dynamically allocates additional throughput to individual partitions experiencing hot spots, preventing throttling and sustaining higher workloads without reconfiguration.[23][21][65][20] AWS-provided benchmarks demonstrate DynamoDB's capability to achieve over 100,000 writes per second per table in provisioned capacity mode, with on-demand mode supporting similar scales after a brief warming period to exceed 100,000 reads per second. New on-demand 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 real-time analytics or e-commerce platforms, while maintaining consistent performance.[22][66] Several factors can influence latency in DynamoDB, including network distance between the client and the AWS region, item size (larger items up to the 400 KB limit increase processing time), and the chosen consistency level. Strongly consistent reads, which query a quorum of replicas for the most up-to-date data, typically incur approximately twice the latency of eventually consistent reads due to the additional coordination required. Additionally, DynamoDB commits to a 99.99% monthly uptime Service Level Agreement (SLA) for standard tables, with service credits issued if availability falls below this threshold, ensuring high reliability alongside low latency. For global tables, the SLA extends to 99.999% availability.[67][64][3][4]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 UTF-8 encoding.[29] This constraint necessitates strategies like compressing data or offloading large attributes to Amazon S3 with references stored in DynamoDB items.[30] Additionally, DynamoDB does not support server-side joins, requiring applications to denormalize data or perform client-side processing for related data retrieval.[68] 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.[20] Scan operations are particularly costly, as they consume read capacity across the entire table or index, making them inefficient for large datasets compared to targeted queries.[69] 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 (UTF-8 encoded); expression attribute names are limited to 255 bytes, which can complicate schema design if exceeded.[70][29] DynamoDB lacks native support for cross-region queries without using global tables, which enable multi-region replication but introduce eventual consistency across replicas.[71] To optimize usage, monitor tables using Amazon CloudWatch metrics for throughput, latency, and errors to detect issues like throttling early. As of August 2025, enhanced throttling observability includesThrottlingReasons fields in exceptions and new CloudWatch metrics for detailed analysis of throttling events.[72][73] Adopt single-table designs to minimize the number of tables, simplifying management and scaling while supporting multiple access patterns via secondary indexes.[39] Implement exponential backoff in retry logic to handle transient errors like provisioned throughput exceeded, starting with short delays and increasing progressively.[74]
Design operations for idempotency, especially in transactions, to safely retry without duplicating effects, using unique identifiers or conditional writes.[54] For scaling, ensure even distribution of partition keys to avoid hot partitions, and leverage global secondary indexes (GSIs) for fan-out scenarios where multiple query patterns are needed without overloading the base table.[20] Integrate with services like Amazon ElastiCache for caching frequently accessed data, reducing read latency and costs in read-heavy workloads.[75]