← ClaudeAtlas

dynamodb-single-tablelisted

Model data in Amazon DynamoDB as one table by default, reading the current AWS guidance before committing to a schema, writing the access patterns down before any keys exist, holding every entity type in one table, overloading generic partition and sort keys across those types, overloading and sparsifying secondary indexes, and splitting items by write rate. Use when designing or reviewing a DynamoDB schema, when a CDK stack is about to gain a second table, when an entity needs a query it has no key for, when application code fetches from two tables to assemble one response, when a Scan or a filter expression appears, when a partition runs hot or a write throttles, and when asked how to model users, orders, events or tenants in DynamoDB.
KensioSoftware/kensio.ai · ★ 1 · AI & Automation · score 68
Install: claude install-skill KensioSoftware/kensio.ai
# Single-table design in DynamoDB DynamoDB is a key-value store with a query language shaped like an index lookup. Almost all of the data modelling advice in the training data is about SQL, and carrying it over produces a table per entity, a join in the application layer, and a `Scan` wherever the keys fall short. That is the reflex this skill exists to interrupt. The default is **one table per service**, holding every entity type, with keys derived from the queries the application makes. AWS puts it plainly in the NoSQL design best practices. "You should maintain as few tables as possible in a DynamoDB application." A second table needs a reason from [When a second table earns its place](#when-a-second-table-earns-its-place). "One entity, one table" is never one of them. ## Read the current guidance before designing a schema This file is a summary, and a summary goes stale. Quotas change, the worked examples carry detail no summary keeps, and a schema outlives the session that produced it. **Fetch the sources below when designing or reviewing a real schema**, and treat them as the authority wherever they disagree with what follows. The two posts, both worth reading end to end for the worked example: - [Creating a single-table design with Amazon DynamoDB](https://aws.amazon.com/blogs/compute/creating-a-single-table-design-with-amazon-dynamodb/) - [Single-table vs multi-table design in Amazon DynamoDB](https://aws.amazon.com/blogs/database/single-table-vs-multi-table-des