Question #1450
A company has developed a real-time multiplayer quiz platform as a web application. The application uses a three-tier architecture in a VPC with Amazon RDS for PostgreSQL in the database layer. Multiple users compete simultaneously, and the platform must display a live leaderboard ranking the top 10 participants. Additionally, users need the ability to pause and resume quizzes while retaining their current scores and progress.
What should a solutions architect implement to fulfill these requirements?
Use Amazon ElastiCache for Memcached to temporarily store scores and leaderboard data for the web application.
Use Amazon ElastiCache for Redis to process and persist scores and leaderboard rankings for the web application.
Configure Amazon CloudFront to cache the leaderboard section of the application for faster delivery.
Create an Amazon RDS for PostgreSQL read replica to offload leaderboard queries and handle read traffic.
Explanation
The correct answer is B. Amazon ElastiCache for Redis is ideal for this scenario because:
1. Real-Time Leaderboard: Redis supports sorted sets (ZSET), enabling efficient ranking updates and retrieval of top scores, critical for a live leaderboard.
2. Persistence: Redis offers snapshotting and AOF (Append-Only File) to persist data, ensuring scores/progress are retained even during pauses or system restarts.
3. Low Latency: In-memory caching ensures millisecond-level response times for real-time updates.
Why other options are incorrect:
- A: Memcached lacks built-in persistence and advanced data structures like sorted sets.
- C: CloudFront caches static content, not dynamic real-time data like a live leaderboard.
- D: RDS read replicas introduce latency for real-time queries and are not optimized for leaderboard ranking operations.
Key Points: Use Redis for real-time rankings with persistence; avoid database-driven or static caching solutions for dynamic data.
Answer
The correct answer is: B