Title: Batching requests and processing in parallel using NestJS
Hello, I have a use case where I want to batch incoming requests from multiple users in my NestJS application to reduce network usage, database queries, and optimize processing. Ideally, I'd like to store the requests and their response objects in an in-memory queue within the same process.
My requirements are:
- Group incoming requests into a single transaction (e.g., 1000 requests within a second).
- Perform batch operations in parallel to reduce the number of database queries.
- Wait for a quorum to be reached for successful operations before sending responses.
- Handle errors and timeouts without affecting other users' requests.