← All projects

Order Store

Asynchronous order processing: orders are stored in MongoDB and published to RabbitMQ, where a background consumer reserves stock atomically, with a dead-letter queue for failed messages.

Source code

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

Tech

Tech stack