The challenge
Real-time digital product fulfillment depended heavily on external supplier availability. When a supplier was slow or a purchase failed, processing took longer and some customers cancelled.
Constraints
- Buying stock ahead of demand ties up money and carries risk if the stock is not sold.
- Digital products can expire, so buffered stock must be used or managed before it does.
- Many orders can draw on the same product at once; stock must never be allocated twice.
- Business users, not engineers, need to decide which products to buffer and from which sources.
Options and trade-offs
Relying only on real-time purchasing keeps no stock risk but leaves every order exposed to supplier delays. Buffering everything removes that exposure but maximizes stock and expiry risk.
The chosen approach buffers selectively: per-product targets set by the business, with risk controls on how much is held. It trades a bounded stock risk for faster, more reliable fulfillment on the products that matter.
What I did
I personally designed and implemented the system in .NET, wrote its unit tests, handed it to QA and launched it into production. Business users configured which products to buffer.
The solution
Each buffered product has a configurable inventory target. Replenishment runs periodically and on demand, buying the difference between available stock and the target before customers order.
Incoming orders use buffered stock first and buy only the remaining quantity from suppliers. Business users choose buffered products and preferred sources, and inventory reporting shows current buffer levels.
Reliability and risk controls
- Product-level locks and semaphores protect quantity allocation under concurrency, so stock is not double-allocated.
- Expiry and risk controls limit how much stock is held and how long.
- If the buffer runs short, orders fall back to real-time supplier purchase rather than failing.
Outcome
Improved fulfillment responsiveness and success rates, reduced cancellations caused by supplier delays, and reduced dependence on real-time supplier availability. Measured before-and-after figures are not published.
This is rules-based automation, not AI forecasting.
Lessons
- Make the business owner of the risk the owner of the setting: configurable targets beat hard-coded rules.
- Design the fallback first; a buffer is an optimization, not a dependency.
- Concurrency control belongs at the unit being allocated, here the product.