
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
A company has developed a new video game as a web application. The application is in a three-tier architecture in a VPC with Amazon RDS for MySQL in the database layer. Several players will compete concurrently online. The game's developers want to display a top-10 scoreboard in near-real time and offer the ability to stop and restore the game while preserving the current scores.
What should a solutions architect do to meet these requirements?
A
Set up an Amazon ElastiCache for Memcached cluster to cache the scores for the web application to display.
B
Set up an Amazon ElastiCache for Redis cluster to compute and cache the scores for the web application to display.
C
Place an Amazon CloudFront distribution in front of the web application to cache the scoreboard in a section of the application.
D
Create a read replica on Amazon RDS for MySQL to run queries to compute the scoreboard and serve the read traffic to the web application.
Explanation:
Why Option B is correct:
Near-real-time requirements: Amazon ElastiCache for Redis is ideal for near-real-time applications because it provides extremely low latency data access (sub-millisecond response times).
Data persistence: Redis supports data persistence to disk, which allows the game to be stopped and restored while preserving current scores. This meets the requirement to "stop and restore the game while preserving the current scores."
Sorted sets functionality: Redis has built-in sorted sets data structures that are perfect for leaderboards. You can use ZADD to add scores and ZRANGE to get the top 10 scores efficiently.
Compute capabilities: Redis supports server-side computations and complex data structures, allowing it to compute and cache scores efficiently.
Why other options are incorrect:
Option A (Memcached): Memcached is a simple key-value store without persistence capabilities. It doesn't support the complex data structures needed for leaderboards and cannot preserve data if the game is stopped.
Option C (CloudFront): CloudFront is a CDN for caching static content at edge locations. It's not suitable for dynamic, frequently changing data like game scores that need near-real-time updates.
Option D (RDS read replica): While read replicas can help with read scaling, they don't provide the sub-millisecond latency needed for near-real-time scoreboards. RDS queries would be much slower than in-memory Redis operations, and stopping/restoring the game would be more complex with RDS.
Key AWS services used:
This solution provides the low latency needed for near-real-time score updates while ensuring data persistence for game stop/restore functionality.