Data & reporting
Foodics working-day boundaries, thin docs, reports that couldn’t be trusted, millions of accounting lines too slow to query.
Case Study · Restaurants & Hospitality · Foodics + Odoo
Re-architected a Foodics + Odoo operation that broke under real-time load — no matter the hardware — into one system that holds at 7,000–20,000 orders a day, unifying Foodics, inventory, manufacturing, accounting and HR on a single source of truth across 32 branches.

01 The client
A fast-growing quick-service food group with its own manufacturing: 32 branches, one head office, one factory, two warehouses — a central warehouse and a central kitchen — and over 600 employees. Traffic runs about 7,000 orders on weekdays and 20,000 on weekends, concentrated in a tight burst from 7 PM to 1 AM.
Young founders who scaled up together from the start, with the business racing ahead of its own systems — the way fast-growing companies do.

02 The core problem
Foodics is a real-time firehose — at peak, 20,000 orders crash in inside a six-hour window. Odoo is a monolith: every order fans out into synchronous writes — order, lines, picking, stock moves, journal entries — each carrying business logic, computed fields and table locks. Under a concentrated real-time burst, that write path is the wall.
And here’s what most teams get wrong: no amount of infrastructure fixes it. Bigger servers, more memory, more workers — the system still breaks, because the bottleneck isn’t hardware, it’s architecture.
The firehose
Weekend volume does not spread across the day — it crashes into a six-hour window, 7 PM to 1 AM.
7 PM – 1 AM peakrest of day
A synchronous monolith cannot absorb a real-time burst by design. This had been fought as an infrastructure problem — it never was one.
03 The starting point
The business ran on spreadsheets and sharp instinct — and it worked, right up until the volume outgrew it. A dedicated team spent its days hand-building inventory, cashflow and reporting spreadsheets. Foodics and Odoo disagreed on basic facts — different working days, thin documentation, reports that were only sometimes accurate.
And despite thousands of orders a day, cashflow was strained, because nobody could see the numbers in time to act on them. Like most fast-scaling operations, the processes lived in people’s heads, not in documents. There was no spec to implement — it had to be designed first, together.

04 The challenges
Foodics working-day boundaries, thin docs, reports that couldn’t be trusted, millions of accounting lines too slow to query.
Buy in tons, store in kilos, recipes in grams — and keep selling even at zero stock.
A returned order splits — sealed goods go back to stock, prepared food is trashed — and the trashed portion has to hit costing, not a plain scrap.
A modifier changes the recipe actually consumed, so it has to flow into consumption and cost correctly.
Internal and GS1 barcodes, waste and by-products, variations, one work-in-progress producing many finished goods, purchase-origin tracking.
Dynamic, conditional approvals up to ten levels deep, routed to the right people with notifications.
Real-time sync under burst load, two-way purchasing, shifts reconciled to weekly settlements — while cash lives in three places at once.
Barcode workflows, shifts aligned to Foodics working days, plus housing and a full HR system for 600 staff.
A return is not one action
A returned order splits. Sealed goods go back to stock; prepared food is trashed — and the trashed portion still has to hit cost of goods sold, not a plain scrap.
Recovered to stockWritten off to COGS
05 The approach
There was no spec to hand me, so I built the understanding myself: diagnose how the operation actually ran, surface the handoffs and exceptions that lived only in people’s heads, design the process with them, then connect every part into one system. My value wasn’t specialist depth in one corner — it was seeing the whole board: how an order at 2 AM has to flow into stock in kilos, cost from a gram-level recipe, a shift-dated P&L, a multi-level approval and a weekly reconciliation — and making all of it agree.
The sharpest call was the first: this was an architecture problem wearing an infrastructure costume. Rather than scale hardware into a wall, I re-architected around the monolith’s limits.
A queue absorbs the burst instead of the ORM choking on it.
Direct SQL, so tens of thousands of orders don’t die one record at a time.
Reporting never competes with the live firehose.
Knowing where the real constraint lived was the whole game.

06 The solution
A message queue with rate limiting absorbs the nightly burst, and direct SQL on the hot path keeps bulk order-to-stock confirmation fast. Two-way inventory and purchasing.
PostgreSQL materialized views with concurrent refresh — collapsing heavy reports from many minutes to seconds and retiring the manual spreadsheets.
A dedicated business date across orders, pickings, moves and scrap, so a 7 PM–1 AM shift is one working day aligned to Foodics — not a broken calendar day.
Multi-level unit conversion from tons to kilos to grams, and negative-stock selling so branches never stop.
Conditional routing by value, one to ten levels deep, group-based, with email, activity and messaging notifications.
Recipe variations, waste and by-products, work-in-progress to multiple finished goods, modifiers mapped into real consumption and cost, and purchase-origin traceability.
Shift-by-shift recognition reconciled to weekly settlements, cash tracked across aggregator, in-house and customer, cost-aware returns booking to COGS, and ZATCA-compliant e-invoicing.
Housing with payroll deductions, payroll, GOSI, loans, overtime, document-expiry tracking, custody, attendance policy, and a mobile app exposing dozens of employee request types — all through the same approval engine.
One ingredient, three units
Buy in tons, store in kilos, cost recipes in grams — reconciled automatically, and it keeps selling at zero stock.
07 The outcome
One real-time source of truth across 32 branches, the factory, the warehouses and head office — Foodics, inventory, manufacturing, accounting and HR finally agreeing. The manual, spreadsheet-driven reporting was replaced by trustworthy real-time reports, so the business could finally see its numbers in time to act on them — the visibility needed to attack the cashflow problem at its root.
Branches keep selling through stockouts, the factory has full traceability, and approvals happen in the system, not in chat threads.
Minutes to seconds
Materialized views with concurrent refresh collapsed heavy reports from many minutes to seconds — and retired the manual spreadsheets.
Why it matters
This wasn’t installing software — it was bringing structure to a 600-person operation whose growth had outrun its systems, translating what they needed faster than they could put it into words.
When a system collapses under load, the fix isn’t a bigger server — it’s a different architecture. Finding the real fault, not the loud one — that’s the work.