Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Inventory for your retailer lives in warehouses, stores and third-party sellers, each with different update latency. Design an availability and reservation architecture across these sources.

Each source, warehouse, store or third-party seller, remains the owner of its own stock, and a central availability service aggregates their updates through events into a read model. Reservations go to the owner of the stock when it can take them in time, or a central service holds safety buffers for sources whose updates are slow. Availability is shown with a confidence level so we never promise slow-source stock at full quantity, counts are reconciled periodically with each source, and the design tolerates partial failure so one unavailable source does not stop the others.

Why this question is asked

Large retailers sell from many places: their own warehouses, the back rooms of physical stores, and the stock of marketplace sellers. Each of these has its own system and reports changes at very different speeds, from seconds to a day. Customers, however, see one product page and expect that in stock means in stock. Interviewers ask this to see whether we can design with uneven data quality rather than pretending all data is equally fresh. In this answer, we will look at why the sources differ, give each source ownership of its stock, build a central read model, decide where reservations go, express availability with confidence, reconcile, and design for partial failure.

1Why Several Sources Make Availability Hard

The difficulty is not the number of sources; it is that their data has different freshness and accuracy. A modern warehouse management system publishes an event for every pick and receipt within seconds. A store's point-of-sale system may send updates every 15 minutes, and store counts are often inaccurate because items are misplaced, stolen or damaged. A third-party seller may upload a stock file once an hour, or once a day.

So when the read model says a store has 3 units, that might really be 0 or 5. Treating every number as equally true is exactly how retailers oversell. The design must carry freshness and reliability along with the number.

Sources and their update latency
SourceHow it reportsTypical lagAccuracy
Own warehouse (WMS)event per movementsecondshigh
Physical store (POS)batched updatesabout 15 minutesmedium, misplaced items
Marketplace sellerfeed or APIhourly to dailyvaries by seller

2Each Source Owns Its Stock; a Central Read Model Aggregates

We do not try to make the central service the owner of all stock. The warehouse system knows what is on its shelves; the store knows its back room; the seller knows its own stock. Each remains the source of truth for its part, which avoids two systems arguing over who is right.

A central availability service builds a read model, a copy shaped for fast reads, from their updates. Warehouse events flow in through Kafka; store and seller updates arrive through adapters that turn batches and feeds into the same normalised event: SKU, location, quantity, timestamp at the source and source type. The read model stores, per SKU and location, the last quantity, when it was measured and how reliable the source is. Product pages and checkout query this service, never the sources directly.

Step throughAvailability architecture
  1. Product pages and checkoutask one service for availability
  2. Availability serviceread model per SKU and location, with confidence
  3. Normalised stock eventsKafka topic, one format for every source
  4. Source adaptersWMS events, POS batches, seller feeds
  5. Sources of truthwarehouses, stores, sellers own their stock

5 layers, from the top down. Step through them one at a time.

3Where Reservations Go

When a customer checks out, the reservation must go to whoever can really hold the unit. For warehouses, that is the warehouse system itself: it can reserve stock immediately and authoritatively, so the availability service forwards the reservation there.

Stores and many sellers cannot reserve in real time; their systems update too slowly or have no reservation API. For them, the central service holds the reservation and protects it with a safety buffer. If a store reports 4 units, we might allow only 2 to be reserved online, keeping 2 as a buffer for in-store sales and count errors that have not reached us yet. The store then gets a pick request, confirms within a time limit, and if it cannot find the item, the order falls back to another location or is cancelled with an apology.

4Showing Availability With Confidence

Instead of one number per SKU, the service computes a promisable quantity from each location, adjusted by how much we trust it, and the page shows what we can stand behind. Fresh warehouse stock counts in full; store stock counts after a buffer; stale seller stock counts at a fraction, or not at all if it is too old.

Java
int promisable(LocationStock s, Instant now) {
Duration age = Duration.between(s.measuredAt(), now);
return switch (s.sourceType()) {
case WAREHOUSE -> s.quantity(); // 10 -> 10
case STORE -> Math.max(0, s.quantity() - storeBuffer(s.sku())); // 4 -> 2
case SELLER -> age.toHours() > 24 ? 0 : s.quantity() / 2; // 6 -> 3, stale -> 0
};
}

The product page then shows a delivery promise that matches the confidence: in stock, delivered tomorrow for warehouse stock; available for pickup today, we will confirm within an hour for store stock; and ships from a partner for seller stock. Customers accept a little uncertainty when they are told about it; they do not accept a cancellation after being promised a firm date.

5Reconciling With Each Source

Events get lost, adapters have bugs, and sources correct their own data. So we reconcile periodically: each source sends a full snapshot, nightly for stores and sellers and hourly for warehouses, and a job compares it with the read model. Differences are corrected, and their size is recorded per source.

The drift metric is valuable in itself. If one store's counts differ by 20 percent every night, its buffer should grow; if a seller's feed is regularly a day old, its confidence should drop. Reconciliation turns into a feedback loop for the buffers.

6Designing for Partial Failure

With dozens of sources, one is always having a bad day. The design must keep the others working. Each adapter runs independently, with its own consumer and circuit breaker, so a broken seller feed does not stall warehouse events. When a source stops updating, its data ages, and the promisable rule naturally reduces what we offer from it until it recovers.

Reservation calls to a source that is down fail fast, and checkout chooses another location with stock. The worst case for a single source failure is fewer options for some customers, not a site-wide outage.

7Follow-up questions

Why not make the central service the owner of all stock?

Because the physical stock is managed by the source systems; the warehouse picks and receives, the store sells over the counter. If the central service claimed ownership, every source change would need to go through it in real time, which slow sources cannot do. Owning the read model and leaving ownership at the source is honest about who actually knows.

How do you choose the size of a store's buffer?

Start from data: the store's count accuracy from reconciliation, its update lag, and how fast the item sells in the store. A slow-moving item in an accurate store needs a buffer of one; a fast seller in a store with large drift may need several units or a percentage.

What happens if two channels sell the last store unit at the same time?

The buffer is designed to absorb that. If it still happens, the store cannot fulfil the pick, the order falls back to another location, and the incident feeds back into a larger buffer for that item and store.

8Conclusion

In this answer, we kept each source as the owner of its stock and built a central read model from normalised events, sent reservations to sources that can hold them and protected slow sources with central buffers, computed promisable quantities by confidence and showed matching delivery promises, reconciled each source with full snapshots to tune the buffers, and isolated sources so one failure only reduces options rather than stopping sales.

What to say in the interviewAbout 80 seconds aloud

Open with

The core idea is that the sources differ in freshness and accuracy, so I would not treat their numbers as equally true. Each source, the warehouse system, the store POS and each seller, stays the owner of its stock.

Then, if they want more

A central availability service builds a read model per SKU and location from their updates, normalised into one event format, recording the quantity, when it was measured and the source type. For reservations, warehouses can hold stock authoritatively, so we forward the reservation to them.

Stores and sellers usually cannot reserve in real time, so the central service reserves against a safety buffer, for example only two of four reported units online, and the store confirms the pick.

Availability is shown with confidence: warehouse stock in full with a firm date, store stock after the buffer with a confirm-later message, seller stock discounted or hidden when it is stale. I would reconcile with each source through periodic snapshots and use the drift per source to size the buffers.

And each source adapter is isolated with its own circuit breaker, so if one source is down, its stock ages out and checkout uses others.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Inventory for your retailer lives in warehouses, stores and third-party sellers, each...": https://scrivio-interview-library.netlify.app/architecture/backend-system-design/47f3a1404f/