System-design interview · Extended interviews
Design ecommerce checkout and inventory reservation
Complete a physical-goods checkout with atomic inventory holds, durable payment progress and a guarded fulfillment decision, then explain when independent warehouses require a saga.
You will learn to
- Use explicit stock quantities to prove reservations cannot oversell.
- Trace quote acceptance, holds, payment, allocation and shipping through durable states.
- Handle expiry, retries and uncertain payment without releasing or selling the same units twice.
Practice in this chapter
8 interview questions with model answers and follow-ups.
Go to interview practiceUseful foundations: Databases, data models, and ACID transactions · Message queues, event logs, delivery guarantees, and backpressure · Data partitioning and sharding · Caching: cache hits, misses, write policies and invalidation
Workload and timing examples are interview assumptions.
Dotted concept links open the relevant explanation in a new tab.
01Choose a checkout that can be completed coherently
Design physical-goods checkout with several cart lines and no backorders. Initially, keep inventory where all requested lines can commit in one database transaction. Customers browse, accept a server-calculated quote, reserve all requested lines, authorize payment and receive an order outcome. Shipping follows confirmed capture. Exclude marketplace settlement and atomic checkout across independently owned warehouse databases from the baseline.
Cart C7 requests two mugs M9 and one notebook N2. There are three sellable mugs. Another customer also wants two. Only one of those mug reservations can succeed before replenishment. A cart is shopping intent, not a reservation; a product page may still display stale availability when the definitive checkout decision rejects a request.
Stock equation
available = onHand − reserved − allocated
| Quantity | Meaning |
|---|---|
onHand |
Sellable physical inventory. |
reserved |
Units held by incomplete checkouts. |
allocated |
Units assigned to confirmed but unshipped orders. |
Every quantity must remain nonnegative. This equation exposes mistakes that a vague stock-service box can hide.
Assume a ten-minute initial hold, checkout admission below 300 ms p95 and 95% of admitted checkouts reaching confirmed allocation within three seconds when payment authorization and inventory dependencies are healthy. A payment timeout may keep the order pending longer. Choose clear stock and money outcomes over pretending every timeout is a definitive failure.
Ask whether all cart lines share one inventory authority, whether backorders are allowed, and whether confirmation means authorized, captured or ready to ship. This answer uses no backorders and one inventory transaction domain: confirmation follows allocation, while dispatch waits for known capture success.
02Functional requirements
Accept a checkout. Validate the authenticated customer’s cart and server-calculated quote, then create or recover one pending order.
Reserve the whole cart. Hold every requested line together or reject the request without leaving partial reservations; expire unconverted holds under a defined deadline.
Take payment and fulfill. Authorize payment, convert valid holds to allocations, capture once and authorize shipment only after known capture success.
Recover and cancel. Expose authoritative order progress, retry unfinished effects and handle cancellation or compensation according to the current stock, payment and dispatch state.
03Non-functional requirements
These are illustrative interview assumptions, not product facts or measured benchmarks. Confirm them before choosing components, then validate the completed design under the stated workload. Here p95 means the 95th-percentile latency: 95% of measured requests take no longer than that value. Report errors and rejected work alongside latency; a fast failure is not a successful outcome.
Workload and local latency. Plan for one million orders/day and a 1,000 orders/s peak with five lines each. Target durable checkout admission below 300 ms p95; measure hot-SKU contention separately from aggregate throughput.
Hold and completion timing. Choose a ten-minute initial hold. As an objective, aim for 95% of admitted checkouts to reach confirmed allocation within three seconds when payment authorization and inventory dependencies are healthy. Provider uncertainty remains pending and is reported separately, not treated as a guaranteed rejection or completion.
Inventory and effect correctness. Keep onHand, reserved and allocated nonnegative, with available = onHand − reserved − allocated. No overselling, partial all-line hold, duplicate capture or duplicate shipment is permitted through supported retries.
Durability and safe availability. Require acknowledged orders, stock transitions and effect identities to survive one database-node failure through synchronous durable replication and safe failover. Refuse new inventory decisions without safe authority; retain allocations while capture is unknown.
Security and scope. Authenticate ownership, validate positive quantities and frozen quote terms, and restrict stock/refund actions to trusted actors. Independent warehouse transactions and regional stock budgets require an explicitly changed contract.
04Trace one complete order before splitting services
Start with a checkout application, a relational database containing orders and inventory, a payment adapter and a durable background worker. The API validates cart version, quantities, quote and customer ownership. One transaction claims request key K4, locks all stock rows in stable order, checks the complete set, creates pending order O401 and its holds, and reserves the quantities. If any line lacks stock, the transaction rolls back all lines.
M9 changes from onHand 3, reserved 0, allocated 0 to 3, 2, 0. Available stock becomes one. The competing request for two mugs fails against current authority even if its browser still shows three.
The worker records a stable payment authorization operation before calling the provider outside database locks. After known authorization, a transaction verifies every hold is still valid, converts them to allocations and confirms the order. Capture is a separate stored payment operation. Only known successful capture permits the later fulfillment authorization.
If the application dies after any local commit, durable pending-work records allow another worker to continue the same order. The whole user flow works with one database; a queue or independent warehouse service is introduced only when a measured or organizational boundary justifies the additional coordination.
Payment remains external, while orders, holds and inventory share atomic decisions.
Read each connection in order
- syncAccept quote / recover orderCustomer → Checkout API
- syncAtomic all-line holdsCheckout API → Orders, stock, holds, work
- syncRead and commit durable transitionsPayment and fulfillment worker → Orders, stock, holds, work
- syncStored authorization/capture identityPayment and fulfillment worker → Payment provider
- asyncCommitted unique shipment intentPayment and fulfillment worker → Warehouse dispatch
05Size line transitions and hot-stock contention
Assume one million orders/day, about 11.6/s on average, with a 1,000 orders/s peak and five lines per order. The peak requires roughly 5,000 reservation-line operations/s. Successful checkout also converts holds to allocations, so that is about 10,000 line transitions/s before releases, shipment, replenishment and retries.
Ten million carts at 2 KB each occupy 20 GB logically. Ten million stock rows at 96 bytes each occupy about 960 MB before indexes and copies. Small raw stock storage does not imply easy concurrency: hundreds of requests may compete for the same three mugs while most rows remain idle.
A stock row held for an illustrative 20 ms per contending transaction has a simple serial ceiling near fifty transactions/s before other work. Holding that lock through a 500 ms payment call could reduce the ceiling to about two/s. This is why network calls must occur outside stock transactions.
At 1,000 admitted orders/s, ten-minute holds could produce 600,000 active workflows and three million line holds. The stock unavailable to other buyers while held matters more than the hold records’ size. Bound per-customer holds and flash-sale admission. A shorter deadline releases stock sooner but rejects more slow legitimate checkouts; choose it using measurements of how long slower checkouts take.
06Freeze commercial terms and name each effect
Interfaces
| Request or message | Contract |
|---|---|
POST /checkouts |
Creates or recovers one pending order with accepted terms. |
GET /orders/O401 |
Returns inventory, payment and fulfillment progress to the authenticated owner. |
POST /orders/O401/cancel |
Requests a guarded transition, not an unconditional inventory increment. |
Create or recover the worked checkout
POST /checkouts
Checkout request with accepted cart and quote versions
{
"key": "K4",
"cartId": "C7",
"cartVersion": 3,
"quoteId": "Q7",
"quoteVersion": 2
}
The version numbers and quote ID instantiate the existing version checks: they must match the customer’s accepted cart and quote. Authentication supplies the customer identity.
Stored records
| Record | Fields or identity | Purpose |
|---|---|---|
| Quote | Quote ID and version | Server-calculated prices, tax, discounts, shipping, currency, version and validity deadline. |
| Hold | order, line, quantity, state, deadline |
One temporary stock claim under a stable identity. |
| Order | Order ID | Frozen accepted lines, lifecycle and payment/fulfillment references. |
| Inventory | SKU, pool, onHand, reserved, allocated |
Authoritative arithmetic for one stock pool. |
| Operation/outbox | Separate stable identity for each effect | Stable effect identity and recoverable work for payment, notification or shipment. |
Reusing K4 with the same cart and quote returns O401. Different parameters under K4 conflict. Obtain customer identity from authentication, validate positive bounded quantities and never accept browser-supplied prices as authority. If a quote has changed or expired before acceptance, present new terms rather than silently charging another amount under the old key.
An order ID alone is not a sufficient key for every operation: authorization, capture, refund and shipping are different effects. Name and persist those identities separately so retries cannot merge unrelated actions or create another charge.
07Explain each stock movement with the same equation
Follow the same two mugs through each state:
| Stage | onHand | reserved | allocated | available |
|---|---|---|---|---|
| Initial | 3 | 0 | 0 | 3 |
| Hold two mugs | 3 | 2 | 0 | 1 |
| Move the hold to allocation | 3 | 0 | 2 | 1 |
| Ship: consume physical stock and allocation together | 1 | 0 | 0 | 1 |
Release is a guarded state transition, not “add quantity back.” Releasing a held line subtracts its quantity from reserved once. Releasing an allocated line is permitted only through a valid pre-dispatch cancellation or compensation and subtracts from allocated once. Repeating either request returns the prior outcome rather than increasing available stock again.
Expiry and allocation lock the same hold and stock records in a consistent order. If allocation wins while the hold is valid, expiry later sees allocated and does nothing. If expiry wins, it marks the hold terminal and removes its reserved quantity; allocation then fails. Check the authoritative database clock after locks are acquired, not a stale timestamp taken before a long wait.
Replenishment and inspected returns also need stable source identities. Replaying a warehouse receipt must not add stock twice. Local constraints and periodic reconciliation compare counters with the underlying hold/allocation records to catch implementation defects.
Both requests use the same stock authority; the loser receives no partial all-line hold.
Read each connection in order
- syncLock all lines; reserve two mugsCheckout A → Order and inventory database
- returnO401 committed; available oneOrder and inventory database → Checkout A
- syncRequest two mugs and other linesCheckout B → Order and inventory database
- returnInsufficient mugs; roll back all linesOrder and inventory database → Checkout B
- syncValid holds → allocationsCheckout A → Order and inventory database
- returnReserved zero; allocated two; available oneOrder and inventory database → Checkout A
08Keep payment uncertainty from corrupting stock decisions
Before calling the provider, persist an authorization attempt with immutable order amount, currency and identity. The provider call runs outside database locks. A timeout leaves the attempt unknown. Query or retry the same operation under the provider's supported contract; a new request identity may authorize or charge again.
Once authorization is known, validate all holds and convert them to allocations in the database transaction before confirming the order. If a hold expired first, fail confirmation and release remaining holds. Void an unused authorization under its own recoverable operation. Canceling an authorization is a new compensating action; it does not erase the earlier provider operation.
Capture then uses one stored operation. Until capture is known successful, shipping remains blocked. If its outcome is unknown, retain the allocations and escalate reconciliation rather than applying the ordinary hold timeout to possibly paid inventory. Allocation and temporary hold are different states with different release policies.
If capture definitively fails, cancel the unshipped order and release allocations through guarded transitions. If a late success is discovered during cancellation recovery, refund through the payment subsystem under a stable identity before reporting fully resolved compensation. Provider deduplication windows are finite; beyond them, reconcile instead of assuming a local key permits safe repeated calls forever.
09Serialize cancellation with the permission to ship
Known capture success is necessary but not sufficient to dispatch a shipment. In one transaction on the order’s owning database, verify all required allocations, current order state and capture outcome, then mark fulfillment authorized and create a unique shipment intent. This is the point after which ordinary cancellation cannot simply free those allocations.
A cancellation that commits first prevents fulfillment authorization and starts the appropriate stock/payment cleanup. If fulfillment authorization commits first, cancellation must obtain a definitive no-dispatch result from the warehouse or move into a return/refund process. A delayed shipping status message does not prove that the parcel has not already left.
The warehouse consumes the shipment intent under its stable identity. Repeated delivery must not dispatch another parcel or decrement physical stock twice. The inventory transition checks the referenced allocation before changing onHand and allocated together. Saving the shipment request alone does not prove that the warehouse dispatched it once.
Keep customer states understandable: awaiting payment, confirmed with capture pending, ready for fulfillment, compensating, canceled or shipped. Support tools can inspect detailed step identities without exposing payment secrets. Notifications communicate committed state changes; they do not decide whether stock is available, payment succeeded or cancellation beat dispatch.
10Scale browsing and admission before splitting transactions
Cache product data and advisory availability, and publish order-history projections for read-heavy pages. Those views may lag; checkout approval and disputed status read the current owning database. Versioned events keep older pending projections from overwriting newer confirmed state. A newly created order remains directly retrievable even before its history list catches up.
Protect flash-sale stock with bounded admission and per-customer quotas. Reject or queue excess contenders before they acquire partial holds elsewhere. Reserve worker/database capacity for reconciliation and release, because starving old workflows can trap real sellable inventory even while new-request latency looks acceptable.
Keep all-line transactions in one database while that ownership is practical. Distribute independent shops or stock pools only when their checkout contract remains compatible with the transaction boundary. More API replicas do not improve a single contended stock row, and read replicas cannot independently sell the same physical units.
If independent warehouses become required, the design changes to a durable sequence of local reservations and compensation, often called a saga. The order can be temporarily pending with some lines held. Confirm only after every required allocation exists, and explicitly recover failed or uncertain steps. The single-database baseline's simultaneous all-line commit no longer applies merely because the coordinator calls several APIs.
Checkout API replicas use cached product views for browsing, then reserve every order line through one inventory/order authority. Workflow workers recover stored payment operations and authorize shipment only after known capture. The fulfillment endpoint receives a stable shipment identity. This diagram retains the chosen single-database inventory contract; independent warehouses require the separate saga extension.
Read each connection in order
- syncBrowse and checkoutCustomer → Checkout API replicas
- syncAdvisory read pathCheckout API replicas → Product / history read views
- syncAtomic all-line reservationCheckout API replicas → Order / inventory / work DB
- syncLoad work / guarded transitionsCheckout recovery workers → Order / inventory / work DB
- syncStored payment operationCheckout recovery workers → Payment provider
- syncAuthorized shipment IDCheckout recovery workers → Fulfillment endpoint
- asyncVerified payment callbackPayment provider → Checkout API replicas
- returnCurrent order statusCheckout API replicas → Customer
11Recover the same order and effect after each crash
| Failure | Recovery |
|---|---|
| Checkout commits, browser reply disappears | Retry K4 and return O401 instead of another set of holds. |
| Payment attempt is stored, worker dies before calling | Resume the same durable operation under its provider contract. |
| Provider acts, response is lost | Keep unknown, reconcile that identity and preserve the appropriate stock claim. |
| Expiry worker stops | Deadlines still govern validity; resumed cleanup uses guarded transitions. |
| Shipment message repeats | Recognize the shipment identity and do not dispatch or consume stock again. |
Use synchronous durable database replication and safe failover to preserve acknowledged orders, stock transitions and effect identities across one database-node failure. A stale or independently writable copy cannot approve the last unit. Backups must include request identities, payment references and pending work, not merely order display rows.
For a future distributed warehouse design, cancellation also has to handle a delayed reserve command whose result is unknown. Use the same stable line identity and a durable terminal cancellation record so an old reserve cannot arrive later and recreate an abandoned hold. This is one reason to keep the initial transaction domain intact until the independent ownership benefit justifies a fuller workflow protocol.
Recovery should prioritize oldest pending and compensating work, with bounded retry and clear escalation. A timeout is a reason to resolve the known operation, not permission to start a fresh checkout.
12Audit stock ownership and explain the tradeoffs
Monitor hot-SKU lock wait, reservation age, oldest pending order, capture uncertainty, compensation backlog and duplicate shipment suppression. Reconcile inventory counters against active hold and allocation records. A healthy checkout HTTP success rate does not prove that stock is neither stranded nor oversold.
Test two customers requesting two of three mugs, a retry after hold commit, expiry racing allocation, capture reply loss and cancellation racing fulfillment authorization. Crash the worker between every remote success and its local result record. Restore data and replay old messages to ensure identities still prevent additional financial or inventory effects.
Authorize stock movements to trusted services, restrict refund/support actions and avoid sensitive addresses or payment tokens in ordinary logs. Quotas also prevent bots from immobilizing inventory through unpaid reservations. Validate returns before replenishing sellable stock; a requested return does not immediately create a physical unit.
The main tradeoff is temporary inventory occupancy in exchange for a recoverable checkout. A longer hold helps slow legitimate users but strands more stock. Independent warehouses improve autonomy but introduce pending and compensation states. Disjoint regional stock budgets can allow local checkout during partitions, but may leave unsold units stranded in another region. Choose these changes deliberately rather than promising the same simple atomic guarantee under every topology.
13Check the design against its requirements
Use the numbered requirements to check the final design. FR refers to the functional list; NFR refers to the non-functional list. Performance rows specify tests still required, not achieved benchmark results.
| Requirement | Design mechanism | Verification and remaining limit |
|---|---|---|
| FR1–2; NFR1–3: atomic checkout admission | Scoped request identity and a short transaction over the complete stock/hold set. | Race two requests for two of three mugs and lose K4’s reply. Recover one order without partial holds; load-test the admitted 300 ms p95 target. |
| FR3; NFR2–3: payment then fulfillment | Persist separate authorization/capture/shipment identities; allocate only valid holds and block dispatch until known capture. | Measure three-second confirmation under healthy dependencies, then lose a capture response. Keep allocations and pending status without shipping or starting another charge. |
| FR4; NFR3–5: guarded cancellation and recovery | Serialize expiry/allocation and cancellation/dispatch; release quantities only through valid prior states. | Race expiry with allocation, repeat shipment messages and attempt unauthorized cancellation. Check the stock equation after every transition. |
| NFR1,4: survive failure and contention | One inventory transaction domain, synchronous durable failover, admission limits and reserved reconciliation capacity. | Fail the database node after acknowledgment and restore pending effect identities. A hot stock row remains serialized; cross-warehouse atomicity is not claimed. |
14Rapid revision
Remember: Holds and allocations both claim stock. An unknown capture keeps its allocation until recovery determines whether money moved.
| Stage | Authoritative effect |
|---|---|
| Browse/cart | Express shopping intent; cached availability reserves nothing. |
| Quote | Save validated price, tax, shipping and currency as a quote with a version and expiry. |
| Hold | In one transaction, check every item and increase reserved stock; retries return the same order. |
| Authorize | Persist the payment operation before calling the provider; unknown remains pending. |
| Allocate | Recheck valid holds and move reserved to allocated before order confirmation. |
| Capture | Use one stored operation; unknown capture retains allocations and blocks shipping. |
| Dispatch | In one transaction, check cancellation and save the decision and unique pending shipment. |
| Ship | Use the shipment ID to reduce onHand and allocated once. |
| Recover | Check current state and reuse each action’s ID during recovery; never change stock counters merely because a request timed out. |
Close with the three-mug equation at each stage and a lost payment response. Mention that the selected single transaction domain gives simple all-line inventory atomicity; independent warehouses are a meaningful extension requiring durable partial progress and compensation, not just more services.
Practise the interview questions
Say your answer aloud before opening the model answer. Then answer the follow-up and compare the reasoning.
What is available stock in this model?
Reveal a model answer
OnHand minus reserved minus allocated. Temporary checkouts and confirmed unshipped orders both claim physical units.
Interviewer follow-up
What happens on shipment?
Reveal the follow-up answer
Reduce onHand and allocated together so available stock does not change merely because allocated units leave.
What the answer must demonstrate: Trace onHand, reserved and allocated consistently through shipment.
Two checkouts each request two of three mugs. What prevents overselling?
Reveal a model answer
A short transaction locks or conditionally updates the same stock authority and checks the full line set. After one reserves two, the other sees only one available.
Interviewer follow-up
Can a cart cache approve the second request?
Reveal the follow-up answer
No. Browsing availability is advisory and may lag.
What the answer must demonstrate: Use one authoritative atomic all-line stock decision, not browsing caches.
How does hold expiry race with allocation?
Reveal a model answer
Both guard current hold state and stock counters in one transaction. Allocation first makes expiry a no-op; expiry first makes allocation fail.
Interviewer follow-up
Why not simply increment available on release?
Reveal the follow-up answer
A retry or stale cleanup could release the same units twice or free already allocated stock.
What the answer must demonstrate: Guard lifecycle and counters together so retry and expiry cannot release twice.
Capture may have succeeded but timed out. Should allocations expire?
Reveal a model answer
No. Keep the appropriate allocated claim, block shipping and reconcile the original payment attempt. A temporary hold deadline is not a release policy for possibly paid inventory.
Interviewer follow-up
What if capture definitively fails?
Reveal the follow-up answer
Cancel and release through guarded transitions, recording the resolved payment outcome.
What the answer must demonstrate: Keep allocations during unknown capture and reconcile the same financial attempt.
Why freeze the accepted quote?
Reveal a model answer
Prices, tax, discounts and shipping terms may change later. The order must preserve what the customer accepted and the provider should charge.
Interviewer follow-up
Can a retry accept a changed amount under the old key?
Reveal the follow-up answer
No. Conflicting key payloads fail or require a deliberate new accepted quote.
What the answer must demonstrate: Preserve accepted commercial terms and reject changed-payload key reuse.
How does cancellation race with shipping?
Reveal a model answer
The order transaction commits fulfillment authorization and a unique shipment intent only if allocations and capture are valid. Cancellation must win before that boundary or use an explicit warehouse cancellation/return flow.
Interviewer follow-up
Why is a separate eligibility read insufficient?
Reveal the follow-up answer
Cancellation could release inventory between the read and an unchecked dispatch call.
What the answer must demonstrate: Order cancellation and fulfillment authorization in one transaction, and create one unique shipment intent.
What changes when lines belong to independent warehouses?
Reveal a model answer
There is no longer one all-line transaction. Persist local step outcomes and compensation while exposing pending state; confirm only after every required allocation exists.
Interviewer follow-up
Can rollback of the coordinator undo a remote hold?
Reveal the follow-up answer
No. Releasing it is a separate idempotent action at the inventory owner.
What the answer must demonstrate: State the loss of global atomicity and persist compensating local steps.
Why do warehouse receipts need identities?
Reveal a model answer
Replaying the same receipt must not add physical stock twice. Record the source identity with the stock increase transaction.
Interviewer follow-up
Are returns immediately sellable?
Reveal the follow-up answer
Only after the agreed receipt and inspection process authorizes replenishment.
What the answer must demonstrate: Deduplicate physical stock receipts and require validated returns before replenishment.
Blank-page exercise · 45 minutes
Build the answer yourself
Design checkout for two of three mugs plus a notebook, then race another customer, hold expiry and a lost capture response.
- Agree numbered functional and non-functional requirements, including all-line inventory scope, confirmation meaning and stock/payment failure behavior. Then use explicit stock quantities to prove reservations cannot oversell.
- Trace quote acceptance, holds, payment, allocation and shipping through durable states.
- Handle expiry, retries and uncertain payment without releasing or selling the same units twice.
- Trace a timeout and a concurrent request using the actual durable records.
- Review the final architecture against every numbered requirement, including measured bottlenecks, targets still needing validation and remaining failure limits.
Check that each component and design decision follows from your requirements and workload.
Recall the key ideas
Answer from memory before opening each card. Explain why the choice works and what it costs. Revisit missed cards tomorrow.
Design ecommerce checkout and inventory reservationThree mugs are on hand and a checkout holds two. What changes when those two are allocated, then shipped?Recall first, then reveal
Available stays one: allocation moves two from reserved to allocated; shipment reduces onHand and allocated by two. Available = onHand − reserved − allocated.
Holds and allocations both claim stock; shipment removes the units and their allocation together.
Return to lessonDesign ecommerce checkout and inventory reservationA payment call times out. May checkout release stock or try a new charge?Recall first, then reveal
No. Recover the same payment operation before deciding; the first charge may already have succeeded.
Resolve before reallocating.
Return to lessonDesign ecommerce checkout and inventory reservationWhy is cancellation harder after fulfillment was authorized?Recall first, then reveal
Dispatch may already be underway. Cancellation must coordinate with the warehouse rather than simply releasing the order’s stock.
After dispatch authorization, cancellation must confirm that the warehouse has not shipped.
Return to lessonFinal revision
Summary and interview notes
Reserve every cart item together, save payment progress, and decide fulfillment against concurrent cancellation. If inventory spans independent warehouses, use a saga to track partial progress and undo reservations when needed.
Remember these points
- Use cached stock for browsing; reserve against current inventory records.
- Preserve the stock equation in every guarded transition.
- Freeze quote and effect identities before external calls.
- Keep allocations while capture is unknown; authorize shipment only after confirmed capture.
Interview tips
- Follow available = onHand − reserved − allocated.
- Trace two of three mugs through hold, allocation and shipment; then lose the capture reply.
Important qualifications
- Traffic and latency figures are interview assumptions, not claims about a named company's deployment.
Continue after the core interview
Explore the advanced version
The advanced lesson keeps the full detailed design. Use these sections when you want to examine the stronger requirements and failure cases.
- Independent warehouse saga
Cross-owner reservations require full partial-progress, late-command and compensation handling.
- Distributed inventory ownership
Separate warehouses change transaction boundaries and fulfillment coordination.
- Regional stock budgets
Disjoint budgets trade partition availability for stranded units and rebalancing complexity.
- Detailed failure recovery
Explore unknown captures, partitioned warehouses and cancellation after dispatch.
Technical references
- AWS saga orchestration patternDefines orchestration and compensation for workflows spanning independent transaction boundaries.
- PostgreSQL explicit lockingPrimary reference for owner-local concurrency control and conflict handling.
Practice marks stay in this browser.