A global ride-sharing platform is designing a backend for its new real-time driver tracking and rider-matching service. The platform must ingest location telemetry from active drivers every seconds (approximately write requests per second). Riders will query the database to find the nearest available drivers within a -mile radius, requiring sub- millisecond response times. The location telemetry database must scale seamlessly during peak hours without administrative overhead. Which architecture represents the most performant, scalable, and operationally efficient solution to meet these requirements?
- Ingest driver telemetry using Amazon Kinesis Data Streams. Process the stream with AWS Lambda and store the location coordinates in an Amazon ElastiCache for Redis cluster with cluster mode enabled. Perform nearby driver searches using Redis geospatial commands (GEOADD and GEORADIUS) against the cluster.Cevap
- BIngest driver telemetry using Amazon Kinesis Data Streams. Process the stream with AWS Lambda and store the locations in an Amazon ElastiCache for Memcached cluster. Use client-side hashing to partition writes across the nodes and query the nodes to compute distance calculations in the Lambda function.
- CIngest driver telemetry using a Network Load Balancer (NLB) routing to an Amazon ECS service on AWS Fargate. Store the coordinates in an Amazon Aurora PostgreSQL database with the PostGIS extension. Configure Aurora Auto Scaling to provision Aurora Replicas to scale the database to support the write throughput.
- DIngest driver telemetry using an Application Load Balancer (ALB) routing to an Auto Scaling group of EC2 instances. Write the coordinates to an Amazon ElastiCache for Redis cluster with cluster mode disabled, relying on Application Load Balancer auto-scaling to absorb sudden traffic spikes.
Cevap
Ingest driver telemetry using Amazon Kinesis Data Streams, process the stream with AWS Lambda, and store the location coordinates in an Amazon ElastiCache for Redis cluster with cluster mode enabled, performing nearby driver searches using Redis geospatial commands.
The correct architecture uses Amazon Kinesis Data Streams to ingest the telemetry and AWS Lambda to process it. Storing the coordinates in Amazon ElastiCache for Redis with cluster mode enabled allows horizontal scaling of both writes and reads across multiple shards. Redis natively supports geospatial indices and commands (such as GEOADD and GEORADIUS) which provide sub- millisecond latency and satisfy the application's query requirements.
Adım Adım Çözüm
Anahtar Kavram
Scaling database write throughput using Amazon ElastiCache for Redis Cluster mode and native geospatial indexing for low-latency queries.