Overview
Order Store is an order-processing system built around asynchronous messaging. Placing an order and reserving stock are handled as separate steps, connected through a message queue.
The challenge
When many orders arrive at the same time, processing everything inside a single web request makes the API slow, and two orders can reserve the same stock. Failed messages must not simply disappear.
How I solved it
- Orders are saved to MongoDB and published to RabbitMQ, so the API can respond immediately.
- A background consumer reads the queue and reserves stock atomically, so stock can never go below zero.
- Messages that fail are moved to a dead-letter queue, where they can be inspected and retried.
- An Angular + Tailwind frontend for placing and following orders.
Tech
- Backend: ASP.NET Core 9
- Database: MongoDB
- Messaging: RabbitMQ
- Frontend: Angular, Tailwind CSS