Skip to main content
InterviewHubPRO
Section Overview
Q36

Question 36 of 50

Part 3: Advanced Architecture, Scale & Internals (Senior / Lead)

72%
Amazon DynamoDB (50 Qs)•Part 3: Advanced Architecture, Scale & Internals (Senior / Lead)

Primary Key Architecture: Partition Key (Hash) vs Composite Primary Key.

senior LevelSystem Design

In Simple Words: Every DynamoDB item is uniquely identified by its Primary Key:

  1. Simple Primary Key (Partition Key only): Items are distributed across physical storage partitions using an internal hash function MD5(PK). Lookups are exact equality matches (PK = "user_123").
  2. Composite Primary Key (Partition Key + Sort Key): PK determines the physical partition; SK determines physical sort order within that partition. Enables rich range queries:
    • begins_with(SK, "ORDER#2026")
    • SK BETWEEN "2026-01-01" AND "2026-11-20"
    • SK > "100"