Open chriscoderdr opened 1 month ago
This task won't be close, will keep updating
We will be using this figma library https://www.figma.com/design/aIciAYC3gzTo73E9NRk6bU/RNUI-Library-(Community)?node-id=33-8909&node-type=canvas&t=36ltdOAXBLHa5Qhm-0
In Morro Taxi, we need a robust queuing system due to the volume and complexity of ride requests that must be processed concurrently and distributed effectively to nearby drivers. After evaluating various options, including Bee-Queue and Kue, BullMQ emerged as the optimal choice.
Advanced Control and Concurrency Management: BullMQ supports advanced job prioritization, rate limiting, and concurrency settings. This is crucial in Morro Taxi to manage thousands of ride requests, ensuring that the nearest drivers are efficiently notified, and unassigned rides are rapidly reassigned.
Reliability and Redis Integration: Built on top of Redis, BullMQ provides reliable, in-memory queuing with durability options, enabling Morro Taxi to handle large-scale requests with high resilience. It also offers delayed jobs and retry mechanisms, making it ideal for managing ride requests with multiple potential retries.
Ease of Monitoring: BullMQ offers in-depth tooling and monitoring options, which allow for real-time insights into the queue's state, job progress, and error handling, crucial for managing an app like Morro Taxi with fluctuating demand and critical uptime needs.
Scalability for Parallel Processing: Given Morro Taxi's requirement to manage thousands of concurrent ride requests, BullMQ’s parallel processing and horizontal scaling are key to achieving high throughput while maintaining queue integrity and performance.
In Morro Taxi, a queuing system is essential to efficiently process ride requests and assign them to available drivers based on proximity and availability. Here’s why:
Driver-User Matchmaking: When a ride request is made, it enters the queue. The system checks for nearby drivers and attempts to match the request with the most suitable driver based on distance. Queuing allows for rapid, fair, and organized assignment.
Retry and Reassignment Logic: If a driver does not accept a ride within a specific time frame, the request needs to be reassigned to other nearby drivers. BullMQ’s queuing supports automatic retries, ensuring the request is quickly reassigned without manual intervention.
Load Management: With potentially thousands of requests at peak times, Morro Taxi needs a system that can manage a high volume of concurrent events. BullMQ allows requests to be processed efficiently in parallel, preventing server overload and ensuring that requests are processed in real-time.
In summary, BullMQ was chosen for its concurrency control, Redis integration, scalability, and ease of monitoring, all critical features for supporting Morro Taxi's real-time ride request processing and driver allocation system.
Research task on architecture and tech stack in preparation to the project