ReinDBby Bandlei

Blog · Federal

The prototype became production: when the data tier can't carry reporting and AI

Brett Rosenblatt ·

Most federal systems I've worked on didn't start with a data architecture. They started with a small team of developers, a few months of prototype money and a demo date. That's how it should work. Prototype funding pays for proving the idea, and nobody should spend it on a data platform for a system that might not survive the demo.

The trouble starts when the prototype succeeds.

How the data tier turns into debt

The pattern is so common it's almost a lifecycle:

  1. The prototype. One database, usually Postgres, designed by whoever wrote the first API. Tables mirror the screens. There's no DBA on the team, because there didn't need to be.
  2. The prototype becomes the program. For DoD work, this is often literal. Under 10 U.S.C. 4022(f), an Other Transaction prototype that's "successfully completed" can go straight to a follow-on production award without another competition. Fast, and that's the point, but the prototype's schema becomes the production schema by contract. Nobody budgeted a redesign, because nothing was ever "redesigned".
  3. Reporting shows up. Leadership wants dashboards. Someone points a BI tool at the production database. Month-end reports now compete with the users the system was built for.
  4. Analytics and AI show up. Data scientists want five years of history. An AI assistant gets wired in that generates SQL against the live tables, or a retrieval pipeline re-reads half the database every night to build embeddings. Each one is a new workload the original design never imagined.

By stage four, one database is doing four jobs: transactions, operational reporting, historical analytics and AI. It does none of them well, and the symptoms land on the people with the least power to fix them: the users and the on-call DBA.

None of this is a developer failure. The prototype did exactly what it was paid to do. The debt comes from never paying for the transition.

Signs you've hit the wall

You don't need a consultant to tell you. Look for:

On Postgres, a quick look at who's running long queries right now tells you a lot:

SELECT usename, application_name,
       count(*)                       AS active,
       max(now() - query_start)       AS longest
FROM pg_stat_activity
WHERE state = 'active'
  AND backend_type = 'client backend'
  AND now() - query_start > interval '30 seconds'
GROUP BY usename, application_name
ORDER BY longest DESC;

If the top rows are your BI tool, a notebook server or an AI service account rather than the application, you've found your problem: it isn't the database, it's the mix.

Fix what's cheap first

A lake or warehouse isn't the first step, and it doesn't fix a bad schema. Copy a messy model into a lake and you get the same mess in more places, plus a pipeline to maintain. Before you build anything new:

When one primary really isn't enough: sharding

Sometimes the problem isn't the mix. The transactional load itself (writes, rows, connections) has outgrown the biggest server you can get approved. That's when sharding comes up: splitting the data across several databases by a key, so each one holds a slice.

Sharding works when there's a natural key that almost every transaction includes, so most queries touch one shard. It's the wrong answer when the pressure is reporting, analytics or AI:

So shard for transaction volume, and move analytics out for analytics load. Plenty of systems end up doing both, sharding the operational tier and feeding one lake from all the shards.

When a lake or warehouse is the right next step

Move the analytics out when one or more of these is true:

Warehouse or lake? A warehouse is modeled, cleaned data built for SQL reporting. A lake keeps raw and historical data in open files for many engines. With open table formats like Apache Iceberg, the line has mostly blurred: you can keep raw change data and modeled reporting tables in the same lakehouse and query both with one engine. I wrote up the components, the Oracle alternatives and the federal and air-gapped details in From a Postgres cluster to a hybrid lakehouse, so I won't repeat them here.

Where the AI workload belongs

"AI" isn't one workload, and it doesn't all belong in the lake:

The federal part: budget and ATO

Two things make this harder in government than in industry:

A short checklist for the program

If you've moved a prototype's database into production on a federal program, I'd like to hear what you'd do differently. My guess is "get a DBA in earlier", but I'm biased.


Brett Rosenblatt is a DBA and performance engineer and a co-founder of Bandlei, which makes ReinDB, a read-only performance monitor for PostgreSQL, Oracle and other databases.