Amazon inventory snapshots
Choose periodic snapshot grain for warehouse-level inventory SLAs while explaining movement-fact tradeoffs.
Concept
fact-table-grain
The primary modeling idea this problem reinforces.
Requirements
4
Business needs the model must satisfy.
Amazon-style prompt: a fulfillment analytics team needs daily 6 a.m. on-hand inventory by warehouse, product, and region for 450 warehouses. The SLA dashboard must load in under two minutes, and planners also ask how stockouts changed after replenishment policy updates. Design the warehouse model and defend snapshot versus movement-grain choices.
Inventory can be modeled as movements, snapshots, or both. The stated SLA needs reproducible daily state without replaying every receipt, pick, adjustment, and transfer for every dashboard query.
- Add an inventory snapshot fact at warehouse-product-day grain.
- Record snapshot date and on-hand quantity.
- Connect snapshots to warehouse and product dimensions through surrogate foreign keys.
- Explain how movement-grain facts can support audit without being the SLA dashboard grain.
Template
Inventory snapshot starter
The model users start from in the full workspace.
Entities
2
Seeded tables visible in the public preview.
Dialect
postgresql
Generated SQL target for this starter model.
This preview is read-only. Open the workspace to edit and verify; saving needs a free account.
Open workspaceTry the question first.
The discussion has other people's approaches and solutions. Give it a real attempt before you read them.