A deep dive into indexing strategies for partitioned (sharded) databases, comparing Local Secondary Indexes and Global Secondary Indexes. Local indexes are partition-scoped, making writes cheap but cross-partition queries expensive. Global indexes re-partition data on a different key, enabling efficient global reads but introducing costly synchronous writes or eventual consistency when updated asynchronously. AWS DynamoDB is used as a real-world example supporting both approaches.

6m read timeFrom arpitbhayani.me
Post cover image
Table of contents
Local Secondary IndexGlobal Secondary Index
3 Impressions