What it is
Running a studio is not one problem, it is forty. Which work is in flight, who has capacity this week, how long things actually took against what was quoted, which recurring checks happened, who was in, who is on leave.
We built it for ourselves, which means it had no client to say no to it. Every time a question came up, a model was added to answer it.
It is in daily use and it works. It is also the project we point at when a client asks why we spend the first part of an engagement on questions rather than code.
The problem
Forty-one models, and two of them we can no longer fully distinguish
There are separate models for client time allocation and for variants of client time allocation. We wrote both. The distinction was real at the time and cannot now be explained without reading the code, which means it cannot be explained to anyone else at all.
Scheduled jobs were running inside the web process
Which is fine with one instance and wrong with two: both wake up and run the same job. We know, because we added a database lock table to stop it — and a lock table is the fingerprint of having already been bitten.
Growth of the schema outran understanding of the problem
Each model was a reasonable answer to a real question. The sum is a system where adding a feature means first working out which of four overlapping tables it belongs in.
What we built
The lock table was the right fix, and the wrong design
A database lock around an in-process scheduler genuinely solved the duplicate-execution problem. On the next project it was replaced properly: a job queue in its own worker container, with the web process explicitly configured not to take work, so the two can never compete.
We kept it, and we use it as the argument
The platform was not rewritten. It works, it is ours, and the money is better spent on client projects. What changed is the method: on later projects the business is understood before the schema file is opened.
The comparison became a standard part of scoping
A later project — a complete financial workflow with invoices, part-payments, partial refunds, deposits, cancellations, an audit log, generated documents and exports — is six models. Not because we got better at Postgres, but because we spent the first week with the person who does the billing.
What the client has now
- The studio runs on it daily: work in flight, capacity, time logged against quoted, recurring checks.
- Scheduled work on client projects now runs in a separate worker process, not in the web container.
- The forty-one versus six comparison is now part of how we scope: understand the business, then model it.
What we took from it
Model count is a symptom of how well you understood the problem
Nobody sets out to write forty-one tables. They accumulate one reasonable decision at a time, each one made before the shape of the whole thing was clear. The fix is not discipline in the schema file, it is spending the first week with the people who do the work — the person who raises the invoices, the person who takes the bookings. Every hour there removes several tables later, and the tables it removes are the ones nobody can explain.