Chapter 10 / 40
The data warehouse
Status: Blocked — waiting for Florian’s first nightly export from Sodiwin.
Every morning at 03:00 the nightly ETL job loads the previous day’s Sodiwin data into D1 (the data warehouse on Cloudflare). Every AI tool, every brief, and every dashboard reads from D1 — not from Sodiwin directly. D1 carries the full history of every table, forever.
What you can query:
- Revenue by customer, brand, rep, or any time period
- Accounts receivable: who owes what, in which aging bucket
- Stock levels across all Sodimo depots
- Full order history for any customer
- Customer purchasing cadence and reorder forecasts
- Outstanding invoices and payment records
The daily cycle.
Florian deposits the day’s CSVs on the NAS (the Synology box in the server room) at 02:50. A single systemd timer on the Framework Desktop fires at 03:00, validates the files, and loads them into D1. By the time the team arrives in the morning, yesterday’s data is already queryable. A one-time historical dump — everything from the start of the ERP through the end of 2025 — will be loaded by Florian separately.
History is preserved.
When a customer’s pricing changes or a product’s status updates, both the old and new state are recorded with the date. This answers questions like “what was this customer’s price list on January 15” or “when did this account’s payment terms change.”
If a bad day lands in the warehouse.
D1 Time Travel keeps a rolling 30-day point-in-time backup of the warehouse. If a nightly file arrives corrupted or a load produces numbers that don’t match Sodiwin, here is what happens:
- The previous day stays authoritative — the bad load is flagged and set aside, it does not overwrite good data.
- Paul gets an email from the ETL job naming the table and the problem.
- Paul forwards the alert to Florian at Sodiwin if the issue is on the data side. Paul debugs the load using Claude with this manual as context, and texts Thomas if blocked.
- Once the upstream fix is in hand, any authorised person can roll the warehouse back to any point in the last 30 days and then roll forward through the corrected export. The procedure is a single Cloudflare CLI command; the manual entry for it lives alongside the ETL runbook.
The team never loses a day of data, and Michel never sees a number that Paul hasn’t signed off.
Parity gate.
Before D1 becomes the authoritative source for any number Michel sees, Paul validates it. He picks two tables, runs the same query against the Sodiwin manual view and against D1, and confirms they match. Which two tables is a call Paul makes with the ETL team — it will be locked before Chapter 2 closes. That sign-off is what closes Chapter 2.