Question

Difficulty: Very hardAWS Database Services

A food delivery service is designing a real-time tracking application. The application must store and query the geographic coordinates (x,y)(x, y) of active delivery couriers. These coordinate updates occur every 33 seconds for each courier. The application needs to query this dataset to find the nearest couriers to a restaurant, requiring under 11 millisecond latency. The location data is temporary, and the service must guarantee that any record older than 55 minutes is immediately removed to prevent stale tracking and excessive storage usage. Which AWS database service is the most appropriate solution for this application?

  1. A
    Amazon RDS for PostgreSQL
  2. B
    Amazon DynamoDB
  3. Amazon ElastiCache (Redis OSS)Answer
  4. D
    Amazon DocumentDB (with MongoDB compatibility)

Answer

Amazon ElastiCache (Redis OSS)
Amazon ElastiCache (Redis OSS) is the correct service because it is an in-memory data store capable of sub-millisecond latency. It features native geospatial indexing to find nearby coordinates and supports immediate, synchronous key expiration (TTL) to guarantee that location data older than 55 minutes is removed instantly.

Step-by-Step Solution

1
Evaluate the latency requirement of the workload.
The application requires under 11 millisecond latency for geospatial queries.
This requirement rules out traditional disk-based database services like Amazon RDS, Amazon DynamoDB, and Amazon DocumentDB, pointing towards an in-memory database solution.
2
Analyze the data expiration (TTL) constraints.
Records older than 55 minutes must be removed immediately to prevent stale courier tracking.
Amazon DynamoDB's TTL is asynchronous and can take up to 4848 hours to purge data, making it unfit. Amazon ElastiCache (Redis OSS) supports immediate key eviction upon expiration.
3
Examine the data access patterns.
The application needs to query geographic coordinates to find the nearest couriers to a point.
Amazon ElastiCache (Redis OSS) natively supports geospatial commands like GEOSEARCH, enabling efficient, real-time spatial calculations in-memory.

Key Concept

Selecting specialized AWS database services based on transactional latency, data structures (geospatial), and data lifecycle management requirements.
Estimated Time:2m 0s
Rate this question