Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Ordered Key Sharding in DynamoDB

Ordered key sharding partitions DynamoDB data into ordered key ranges across shards instead of using hash-based distribution, enabling efficient range queries and ordered scans while preserving write scalability.

Background

- **DynamoDB** is Amazon's fully managed NoSQL key-value database, widely used by companies of all sizes. It's known for high scalability and low latency, but has quirks in how it distributes data across storage partitions. - **Ordered Key Sharding** is a lesser-known design technique to avoid DynamoDB's "hot partition" problem. In default operation, DynamoDB uses the partition key to hash data across physical storage nodes (partitions). If too many queries hit the same partition key value, performance degrades. Writers of the article propose pre-splitting ordered keys (like timestamps or sequential IDs) across virtual shards to spread load evenly, which isn't obvious to most DynamoDB users. - This article fills a gap in the broader discussion around **DynamoDB data modeling**. Most official documentation emphasizes single-table design, secondary indexes, and access patterns. Ordered key sharding is a more advanced technique, often rediscovered independently by teams hitting throughput limits. - The author's blog, *death.andgravity.com*, is known for deep-dive technical posts on databases and distributed systems, popular among backend engineers and architects.

Related stories