A real-time recommendation system requires low latency. Which data storage strategy is best for serving user profiles and item embeddings?
In-memory key-value stores offer sub-millisecond reads, suitable for real-time serving.
Why this answer
An in-memory key-value store like Redis is ideal for serving user profiles and item embeddings in a real-time recommendation system because it provides sub-millisecond read/write latency by keeping data in RAM. This directly meets the low-latency requirement for fetching embeddings and profiles on each request, without the overhead of disk I/O or complex query processing.
Exam trap
CompTIA often tests the misconception that any database with 'fast' in its name (like InfluxDB) is suitable for real-time serving, but the trap is that time-series databases prioritize write throughput and range queries over low-latency point lookups, which is the actual requirement here.
How to eliminate wrong answers
Option A is wrong because time-series databases like InfluxDB are optimized for timestamped metrics (e.g., CPU usage, sensor data) and not for low-latency key-based lookups of user profiles or embeddings; they introduce unnecessary indexing and query overhead. Option C is wrong because relational databases with joins require disk-based storage and SQL parsing, which adds significant latency (often tens to hundreds of milliseconds) compared to in-memory key-value access, making them unsuitable for real-time serving. Option D is wrong because a data lake in object storage like Amazon S3 has high latency (typically 100-200 ms per request) due to HTTP-based API calls and is designed for batch analytics, not for serving individual records in real-time.