Amazon DynamoDB is a managed NoSQL database service provided by Amazon Web Services (AWS). It supports key-value and document data structures and is designed to handle a wide range of applications requiring scalability and performance.
History Werner Vogels, CTO at Amazon.com, provided a motivation for the project in his 2012 announcement. Amazon began as a decentralized network of services. Originally, services had direct access to each other's databases. When this became a bottleneck on engineering operations, services moved away from this direct access pattern in favor of public-facing APIs. Still, third-party relational database management systems struggled to handle Amazon's client base. This culminated during the 2004 holiday season, when several technologies failed under high traffic. Traditional databases often split data into smaller pieces to save space, but combining those pieces during searches can make queries slower. Many of Amazon's services demanded mostly primary-key reads on their data, and with speed a top priority, putting these pieces together was extremely taxing. Content with compromising storage efficiency, Amazon's response was Dynamo: a highly available key–value store built for internal use. Dynamo, it seemed, was everything their engineers needed, but adoption lagged. Amazon's developers opted for "just works" design patterns with S3 and SimpleDB. While these systems had noticeable design flaws, they did not demand the overhead of provisioning hardware and scaling and re-partitioning data. Amazon's next iteration of NoSQL technology, DynamoDB, automated these database management operations.
Overview DynamoDB organizes data into tables, which are similar to spreadsheets. Each table contains items (rows), and each item is made up of attributes (columns). Each item has a unique identifier called a primary key, which helps locate it within the table.
DynamoDB Tables A DynamoDB Table is a logical grouping of items, which represent the data stored in this Table. Given the NoSQL nature of DynamoDB, the Tables do not require that all items in a Table conform to some predefined schema.
DynamoDB Items An Item in DynamoDB is a set of attributes that can be uniquely identified in a Table. An Attribute is an atomic data entity that in itself is a Key-Value pair. The Key is always of String type, while the value can be of one of multiple data types. An Item is uniquely identified in a Table using a subset of its attributes called Keys.
Keys In DynamoDB A Primary Key is a set of attributes that uniquely identifies items in a DynamoDB Table. Creation of a DynamoDB Table requires definition of a Primary Key. Each item in a DynamoDB Table is required to have all of the attributes that constitute the Primary Key, and no two items in a Table can have the same Primary Key. Primary Keys in Dynamo DB can consist of either one or two attributes. When a Primary Key is made up of only one attribute, it is called a Partition Key. Partition Keys determine the physical location of the associated item. In this case, no two items in a table can have the same Partition Key. When a Primary Key is made up of two attributes, the first one is called a "Partition Key" and the second is called a "Sort Key". As before, the Partition Key decides the physical Location of Data, but the Sort Key then decides the relative logical position of associated item's record inside that physical location. In this case, two items in a Table can have the same Partition Key, but no two items in a partition can have the same Sort Key. In other words, a given combination of Partition Key and Sort Key is guaranteed to have at most one item associated with it in a DynamoDB Table.
DynamoDB Data Types DynamoDB supports numerical, String, Boolean, Document, and Set Data Types.
DynamoDB Indices Primary Key of a Table is the Default or Primary Index of a DynamoDB Table. In addition, a DynamoDB Table can have Secondary Indices. A Secondary Index is defined on an attribute that is different from Partition Key or Sort Key as the Primary Index. When a Secondary Index has same Partition Key as Primary Index but a different Sort Key, it is called as the Local Secondary Index. When Primary Index and Secondary Index have different Partition Key, the Secondary index is known as the Global Secondary Index.
Architectural patterns in DynamoDB data modeling DynamoDB data modeling patterns are architectural approaches used in Amazon DynamoDB, a NoSQL database service designed for distributed systems. These patterns address various data organization challenges and include "Single Table Design", which consolidates related data while adhering to DynamoDB's 400KB item size limit; "Multiple Table Design", which separates data into distinct tables based on access patterns and data model differences; and Hybrid Design, which blends both approaches to balance flexibility and efficiency. Additional patterns described in AWS documentation include "Event Sourcing", where data changes are stored as immutable events, enabling historical state reconstruction; "Materialized Views", which simplify analytical queries through pre-computed aggregations, often implemented via DynamoDB Streams, application-level processing, or periodic batch updates using Lambda functions. As well as "Time-Series Design", optimized for workloads like logging and metrics, typically using a partition key for entity identification and a sort key representing timestamps to efficiently query time-based datasets. Each pattern addresses specific technical requirements. "Single Table Design" can optimize query efficiency by co-locating related data under the same partition key to reduce access latency. "Multiple Table Design" enables separation of concerns by isolating data into purpose-specific tables with distinct access patterns. "Event Sourcing" preserves a historical log of state changes, often implemented with immutable data storage. "Materialized Views" simplify complex analytical queries through pre-aggregation strategies tailored to access patterns. "Time-Series Design" uses partitioning and sorting strategies to efficiently store and query large volumes of temporal data.
… excerpt ends here. Continue reading the full article.



