The problem
Sellers listed the same stock on Shopify, Amazon and Walmart. Inventory was synchronised between the channels with a delay of around five minutes. That gap was long enough for the same item to sell on two channels at once: orders were lost, stock was oversold, and the business absorbed the cost of cancellations.
The goal was simple to state: every channel should see the same inventory, as close to real time as possible, without adding manual reconciliation work.
Architecture
I architected an event-driven integration backend on Azure Functions and Cosmos DB. Changes from each marketplace arrive as events; functions ingest them, normalise each channel’s format into a single inventory model, persist the result in Cosmos DB, and distribute the update to the other channels.
How a change flows through the system
- Ingest: an order or stock change on any channel triggers an Azure Function through a webhook handler.
- Normalise: the function maps the channel-specific payload onto one shared inventory model.
- Persist: the current order and inventory state is written to Cosmos DB.
- Distribute: the new stock level is pushed to the other channels so all three agree.
Engineering decisions
Event-driven, serverless compute instead of scheduled polling
Reacting to each change as it happens is what removes the multi-minute window; Azure Functions scale out with order bursts and cost nothing while idle.
Trade-off: event-driven systems must tolerate duplicate and out-of-order deliveries, so handlers need to be idempotent and updates ordered per item.
One normalised inventory model shared by every channel
Instead of point-to-point mappings between each pair of marketplaces, every channel translates to and from a single model. Adding a channel means writing one adapter, not three.
Trade-off: the shared model has to be designed carefully up front so channel-specific fields don’t leak into it.
Cosmos DB for order and inventory state
A low-latency, horizontally scalable document store suits high-frequency reads and writes of small inventory records during traffic spikes.
Trade-off: throughput is billed in request units, so partition-key choice and document size directly affect cost.
Outcomes
- Inventory sync latency reduced from about 5 minutes to under 2 seconds.
- Overselling eliminated across Shopify, Amazon and Walmart.
- $150k+ in previously lost quarterly revenue recovered.
Skills demonstrated
Serverless and event-driven design with Azure Functions, data modelling on Cosmos DB, and .NET integration work with ASP.NET Core — the same stack described in my experience building multi-channel e-commerce integrations.