{
  "id": 10925387,
  "title": "One stock pool, four sales channels: a reservation ledger instead of a computed available",
  "url": "https://urgent.news/2026/09/30/one-stock-pool-four-sales-channels-a-reservation-ledger-instead-of-a",
  "topic": "finance",
  "section": "Finance & Markets",
  "published": "2026-09-30T11:15:25.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/fulfillnexa/one-stock-pool-four-sales-channels-a-reservation-ledger-instead-of-a-computed-available-3okg"
  },
  "original_language": "en",
  "account": "The issue of overselling in multi-channel e-commerce is not due to a data problem, but rather a concurrency problem that can be resolved through better implementation. Instead of attempting to calculate available stock with complex arithmetic, the solution lies in reserving stock itself using a reservation ledger. This approach involves creating a table called \"stock_movement\" to track movements of stock between physical sites and channels. By modeling the pool as movements rather than a fixed number, the system can more accurately manage stock levels.\n\nA unique index is created on the \"stock_movement\" table for reservations, ensuring that retried webhook requests are harmless. When a reservation is made, it is treated as a guarded write, meaning the check and the write must be combined into one statement to prevent race conditions. The system inserts a reservation record, and if the requested units are available, the order is accepted; otherwise, it is rejected. This method eliminates the window of time where another channel could take the same units, as the reservation itself is the atomic operation.\n\nPostgres evaluates the where clause against a snapshot taken during the insert, locking the row explicitly and ensuring a serializable transaction for multi-SKU orders. For multi-line orders, it is recommended to lock the rows in a deterministic order to avoid deadlocks. Reservations must have a time-to-live (TTL) to prevent leaks, such as payment failures, abandoned checkouts, marketplace orders that never sync, or cancelled lines. A sweep job updates reserved stock to be released when the reservation expires, either manually or by running the sweep job. This approach provides transparency in stock levels and ensures that overselling is avoided.",
  "summary": "Multichannel overselling is not a data problem. It is a concurrency problem that people keep trying to solve with better arithmetic. The usual implementation computes availability on read: const available = onHand - allocated - safetyBuffer ; if ( requested <= available ) accept ( order ); else reject ( order ); Every term in that expression is correct and the code is still wrong, because between…",
  "key_points": [
    "Implement reservation ledger to track stock movements between sites and channels.",
    "Unique index on stockmovement table prevents race conditions in reservations.",
    "Set time-to-live for reservations to release stock when expired."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}