Archicise
Exercise

Design a Gaming Leaderboard (DynamoDB)

Design a DynamoDB schema for a real-time gaming leaderboard system that handles global and regional rankings.

Functional Requirements

  • Track player scores across multiple games/modes
  • Global leaderboards and regional/friend leaderboards
  • Real-time score updates and ranking
  • Historical leaderboards (daily, weekly, all-time)
  • Player profiles and statistics
  • Achievements and badges

Non-Functional Requirements

  • Sub-millisecond read latency for rankings
  • Handle millions of concurrent players
  • Support thousands of score updates per second
  • Cost-efficient for read-heavy workloads

Questions to Consider

  • How do you design partition and sort keys for leaderboard queries?
  • What strategy enables efficient rank calculation?
  • How do you handle hot partitions from popular games?
Your Solution

Single-Table Design

Design the single-table schema with access patterns. Identify all access patterns first, then design partition keys, sort keys, and item types.