An application developer is launching a new multiplayer gaming platform. The game must store player session states with single-digit millisecond read and write latency. The traffic is highly volatile and fluctuates throughout the day, experiencing sudden spikes during weekend tournaments. Which database configuration should a solutions architect recommend to support this workload while minimizing management overhead?
- AAmazon DynamoDB configured with provisioned capacity mode and a monotonically increasing partition key such as login timestamp
- Amazon DynamoDB configured with on-demand capacity mode and a high-cardinality partition key such as user IDAnswer
- CAmazon RDS PostgreSQL DB instance with multiple Read Replicas configured to promote a replica to primary during write spikes
- DAmazon DynamoDB configured with provisioned capacity mode and a static write capacity unit setting matched to average daily traffic
Answer
Amazon DynamoDB configured with on-demand capacity mode and a high-cardinality partition key such as user ID
Amazon DynamoDB configured with on-demand capacity mode is ideal for workloads that are highly unpredictable and spiky, as it automatically scales read and write capacity in response to traffic. Using a high-cardinality partition key like user ID ensures that traffic is distributed evenly across multiple partitions, avoiding hot partitions and maintaining single-digit millisecond latency.
Step-by-Step Solution
Key Concept
Designing high-performing, scalable NoSQL databases with Amazon DynamoDB by choosing the appropriate capacity mode and avoiding hot partition keys.