---
title: "Case study: It works. Does it hold up? · Alexander Hirschfeld"
description: "Anonymised case study: a data platform built with AI assistants works, but won’t carry hundreds of accounts. Analysis, target infrastructure and a cost estimate."
url: https://www.alexander-hirschfeld.de/en/case-studies/vibe-coding-scaling
language: en
---

[All case studies](https://www.alexander-hirschfeld.de/en/case-studies)

Case study

# It works. _That does not mean it holds up._

Eleven months, almost 3,000 commits, built with AI assistants. The result is a data platform that runs in production for 27 brands. In its current form, it won’t carry hundreds of accounts. How I found out, and which infrastructure comes next.

The database is 27 GB. In just over five weeks it produced 494 GB of write-ahead log, a little more than eighteen times its size.

Each cell is as big as the entire database. Write-ahead log from query statistics, 20 Sep to 27 Oct 2026. It counts written changes, not data growth.

- Project

  B2B platform for advertising and sales data from a large marketplace

- Goal

  Find out whether the system will hold up through the next growth step

- Analysis

  Codebase, routines, database and jobs reviewed and assessed

- Result

  Target infrastructure, cost estimate and a plan for the next steps

## At a glance

1. ### It runs.

   Built with AI assistants in eleven months, in production for 27 brands.

2. ### It doesn’t hold up.

   A single database does almost everything, and the same data goes through it again and again. That isn’t made for hundreds of accounts.

3. ### There is a plan.

   Two days of analysis with AI agents and counter-tests. What came out of it is a target infrastructure with separate services, plus a cost estimate.

## Built at the pace _of AI._

In November 2025, a founder starts on a prototype. He builds it with AI assistants. Four out of five commits name one of them as author or co-author. Eleven months later, 27 brands use the platform to analyse their advertising and sales and to steer their bids.

- 2,944

  commits in eleven months

- 81%

  of non-merge commits with an AI assistant as author or co-author

- 680,000

  lines of code in TypeScript, SQL and scripts

- 165

  deployed serverless functions

- 308

  tables and 317 SQL functions in the database

- 226

  entries for background work

Excluding merges, 1,940 of 2,388 commits name an AI assistant.

Commits per month

1. November 2025: 43 commits
2. December 2025: 18 commits
3. January 2026: 7 commits
4. February 2026: 33 commits
5. March 2026: 183 commits
6. April 2026: 68 commits
7. May 2026: 364 commits
8. June 2026: 188 commits
9. July 2026: 433 commits
10. August 2026: 466 commits
11. September 2026: 648 commits
12. October 2026: 493 commits

1) Nov 2025 First commit; two days later a local version runs
2) Jan 2026 First data pull from the marketplace goes live
3) Feb 2026 Daily sync, first database migrations
4) Sep 2026 Peak with 648 commits in one month

From the version history, merges included. October counts up to the 27th, the first day of the analysis.

The curve shows the pace AI assistants make possible. From May 2026, well over a hundred changes land every month, 648 in September. New requirements end up wherever they’re quickest to solve at the time. Sometimes as a serverless function, sometimes as an SQL function in the database, sometimes as one more schedule.

Background work in six places

- Dedicated job server 85
- Operations and check scripts started by hand 62
- Schedules inside the database 51
- CI workflows 14
- Standalone scripts 11
- Scheduled routines of an AI assistant 3

226 entries according to the inventory. Not all of them run regularly; some are one-off runs or only documented.

For a product at this stage, that’s the right order. First you need features customers actually use. Before the next growth step, though, a second question comes up: which parts can carry many times today’s data?

## Working _is not the same as viable._

Every feature does what it should. The tests are green and customers work with it. That’s exactly why nobody notices the setup isn’t made for the next stage of growth.

> “Just because everything works does not mean a solution is viable. AI is reluctant to tell you that.”

- ### AI solves the task it is given

  An assistant builds the next feature so it works today. Whether it still holds at a hundred times the data is rarely part of the task. It hardly ever brings that up on its own.

- ### Every fix lands in the nearest place

  New requirements get solved wherever it is quickest at the time. After eleven months, background work is spread across six places.

- ### Load grows quietly

  With 27 brands, the database is small and fast enough. In day-to-day use, nobody sees that it writes eighteen times its size in five weeks.

## 27 GB stored. _494 GB written._

At 27 GB, the database is small. What gets expensive is how often the same data is read, written and recalculated.

- 26.4m

  SQL calls in just over five weeks

- 155 h

  execution time in the database

- 494 GB

  write-ahead log, a little more than 18 times the database

Write-ahead log per data path

- Import daily reports 126.0 GB
- Reconcile negative keywords 73.6 GB
- Reconcile keywords 39.3 GB
- Reconcile product targets 21.3 GB
- Store bid snapshots 20.3 GB
- Roll up windows of up to 60 days 19.7 GB
- Compute features for the bidding logic 6.4 GB

Execution time per data path

- Import daily reports 23.2 h
- Compute features for the bidding logic 13.9 h
- Real-time service of the database 13.4 h
- Roll up windows of up to 60 days 11.4 h
- Prepare bid suggestions 7.4 h
- Rebuild market metrics 6.6 h
- Detect missing objects 4.5 h
- Reconcile sales data 4.4 h
- Store bid snapshots 3.0 h

Query statistics of the production database from 20 Sep to 27 Oct 2026, cumulative. They include causes that have since been fixed.

### Three patterns that keep coming back

1. 1.38m Two approximations with different definitions. They show the order of magnitude, not an exact ratio.

   #### Reports are loaded several times

   Values for past days still change afterwards. So overlapping periods are requested and imported again and again, around 1.38 million report rows a day. In the stored data, one day equals roughly 71,000 fact rows.

2. 6.5m Object observations per day.

   #### Reconciliation also writes what did not change

   Around 1.63 million campaign objects are reconciled four times a day. For known objects, the database rewrites every delivered column, even when nothing changed. Negative keywords alone account for 73.6 GB of write-ahead log.

3. 175.6 GB Temporary data during rebuilds.

   #### Whole windows are recalculated

   Derived market metrics are deleted per scope and rebuilt from scratch. That produced 175.6 GB of temporary data. Roll-ups read up to 60 days every time.

### What the team had already improved

- Paging by key instead of by offset
- Imports as set operations in the database instead of many single calls
- Complete campaign reports skip unchanged rows
- Nightly import: 998,000 rows in 12.4 minutes with four writers
- Faster read paths for the bid calculation

The analysis builds on this. Part of the cumulative load dates from before these changes.

## And with hundreds _of accounts?_

The analysis deliberately thinks big: 100 customers, each with the data volume of all of today’s customers combined. That shows which part hits its limit first.

| Metric                       | Today | 100 times |
| ---------------------------- | ----- | --------- |
| Active brands                | 27    | 2,700     |
| Campaign objects             | 1.63m | 163m      |
| Object observations per day  | 6.5m  | 653m      |
| Report rows per day          | 1.38m | 138m      |
| Database in its current form | 27 GB | 2.7 TB    |

Values from the capacity model of 27 Oct 2026. Observations are not writes, and the current form is not a forecast for the new data storage.

Today, one relational database does almost everything: permissions, campaign inventory, imports, roll-ups, analytics and bid calculation. At this volume, all of these tasks compete for the same resources, and every repetition grows with them.

In my assessment, the setup won’t carry hundreds of accounts in this form. More hardware pushes the limit out, but the repetition stays.

### On top of that come the marketplace’s limits

Quotas apply per application and operation. New servers, extra IP addresses or copied credentials don’t create more capacity. Some report types allow only about one call per minute once a small burst is used up.

An example with documented values

100 sellers × 5 calls per second: 500 per second requested. Application limit: 100 per second. 400 per second wait.

Worked example using the documented default values, not a measurement of the quota actually granted.

## Two days, _five steps._

The analysis consists of an inventory, parallel specialist reviews by AI agents and executable counter-tests. I didn’t change anything in production.

1. ### Step 1: Take stock

   Functions, tables, jobs, callers and dependencies. I queried the production database read-only, each query with an eight-second time limit. The scripts ship with the report, so the team can rerun the measurements on their own later.

   Result: A complete map of all functions, tables and jobs

2. ### Step 2: Map the load

   Query statistics, write-ahead log and volume drivers such as brands, marketplaces and campaigns. I kept apart what is stored, what gets processed over and over and what actually grows.

   Result: A load map per data path

3. ### Step 3: Design the target

   Control, history, computation and analytics as separate jobs. Plus a cost model as a spreadsheet with visible assumptions and three cases.

   Result: Architecture and cost estimate

4. ### Step 4: Check against real features

   Three AI agents independently compared reports, bidding logic and operational features with the design, every claim with a reference into the code. Counter-tests ran on isolated PostgreSQL and ClickHouse instances with synthetic data.

   Result: 520 existing tests and 40 new probe groups passed

5. ### Step 5: Clarify external limits

   Quotas, approvals and data availability of the marketplace, checked against the official documentation. Along the way, I came across a new change stream from the provider.

   Result: A list of the evidence still open with the provider

## Every job _in its place._

Today, control, history, computation and analytics all run through one database. The design separates them. A change only recalculates the results it actually affects.

1. Intake

   Connectors and job control

   Reports and changes from the marketplace, with shared quota control and priorities per customer.

2. Valid data state

   Object storage, Parquet, Iceberg or DuckLake

   Original reports and versioned detail history. Cheap, immutable and rebuildable at any time.

3. Computation

   Workers with DuckDB

   Preparation and targeted recalculation of affected slices. Scales independently of the rest.

4. Analytics

   ClickHouse or StarRocks

   Detail queries and matching pre-aggregates for the app, exports and bidding logic.

Control

PostgreSQL

Permissions, configuration, current campaign inventory, jobs, dependencies and published versions.

What happens on a change?

Unchanged report

- Input

  The same content arrives again

- Work

  Compare with the valid state

- Result

  No new version

The report still has to be downloaded and parsed. But thanks to the comparison, there are no new values and no follow-up calculations.

Involved: Intake, Valid data state

100 becomes 120

- Input

  Value of an old day: 100 → 120

- Work

  −100 and +120, or replace the slice

- Result

  New value: 120

For an additive metric, the net contribution is +20. For medians and shares, a targeted rebuild of the slice is more reliable.

Involved: Intake, Valid data state, Computation, Analytics

Product changes group

- Input

  A product is moved to a new group

- Work

  Refresh affected historical joins

- Result

  New group totals

The raw values stay the same. Because reports group by today’s assignments, old values have to show up in the new group. A small change can touch many rows.

Involved: Control, Computation, Analytics

Delete before old update

- Input

  Version 12 deletes, version 11 arrives later

- Work

  Keep the tombstone, ignore version 11

- Result

  The record stays deleted

The highest version per key wins. Arrival time and file name are not a reliable order.

Involved: Intake, Valid data state, Computation, Analytics

Marketplace throttles

- Input

  The interface reports: limit reached

- Work

  The job waits for free quota

- Result

  No pointless scaling up

More workers don’t change the limit. Other customers and sources keep working in the meantime.

Involved: Intake, Control

Rebuild aborts

- Input

  New results are only partly written

- Work

  The previous publication stays valid

- Result

  No half-old, half-new report

New states are built and checked in full, then made visible with a pointer switch. Running reports keep their state.

Involved: Valid data state, Computation, Control, Analytics

- ### A new change stream

  Since autumn 2026, the provider has been delivering changed advertising data as files with version numbers, corrections included. That can replace part of the repeated report pulls. Before it can, every current feature needs a proven data path, because the stream groups some details together.

- ### A deadline that comes anyway

  According to the provider, the current reporting interface is due to be retired in mid-2027. So a successor is needed either way, rebuild or not.

### Deliberately not in the first step

- A rewrite in Rust or sharding the database. Neither removes repeated pulls or wrong totals.
- A dedicated streaming database, as long as no feature needs the extra freshness.
- A separate cluster per customer. It isn’t needed at the scale examined.
- Two analytical databases. ClickHouse and StarRocks are compared on the same data, then one stays.

## Services that _grow separately._

The goal was an app that grows with its customers. So the design also separates the services that answer requests. Each gets its own resources and scales by its own bottleneck.

Target infrastructure

App and exports

Users, agencies, shared reports

Shared API entry point

Kubernetes cluster in an EU cloud

Requests

- Identity

  Keycloak

  Login, password, MFA, sessions

- Core API

  Go

  Permissions, settings, change requests

- Analytics API

  separate deployment

  Dashboards, filters, drill-downs

Background

- Query workers

  own pool

  Large exports and analyses

- Import and compute workers

  Python with DuckDB

  Preparation, targeted recalculation

- Bidding workers

  own queue

  Time-critical decisions

- Connectors

  shared quota control

  Pulls and changes at the marketplace

Operations

- Observability

  Prometheus, Grafana, Loki

  Metrics, logs, backlog per queue

* PostgreSQL

  Two shards with three copies each

* Analytical database

  Two shards with three copies each

* Object storage

  With a copy at a second location

Outside the cluster

- Workflow engine

  Managed service

  Multi-step workflows, resumption, priorities

- Marketplace

  Interfaces and change stream

  Delivered to cloud storage chosen by the provider

Servers in the cost model: 30, up to 38 at peaks

- 3 Cluster control plane
- 3 API, identity, connectors
- 8 + 8 Import and compute workers
- 2 Bidding workers
- 6 PostgreSQL
- 6 Analytical database
- 2 Observability

Simplified view. The analytics API and query workers were added after the cost model; their resources are not yet listed separately there.

### Four paths for requests

| Service          | Tasks                                                                | Operation                                             | Scales by                                                    |
| ---------------- | -------------------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------ |
| Identity service | Login, password reset, MFA, sessions                                 | Own resources with protected minimum capacity         | Sign-ins, independent of analytics                           |
| Core API         | Users, permissions, settings, saved views, accepting change requests | Short requests, small responses, operational database | Load and response time, within the database connection limit |
| Analytics API    | Dashboards, tables, filters, drill-downs                             | Pre-aggregates, cache or bounded detail queries       | Concurrent requests and memory                               |
| Query workers    | Large exports, special analyses, historical analysis                 | Durable jobs with bounded parallelism                 | Runnable backlog and wait time, capped by the database       |

### Large analyses run as jobs

1. Accept

   The analytics API checks permissions, filters and data version, stores the job and replies at once with a job ID.

2. Run

   A query worker computes as soon as the budget has room. Identical requests are merged.

3. Fetch

   The app shows the status and loads the finished result, large exports straight from object storage.

That way a long analysis doesn’t hang on an open connection. Reloading the page or losing the connection doesn’t stop it.

### Separate services alone are not enough

If the analytics API and the query workers draw on the same unbounded database resources, one large export still slows down every dashboard. So you also need:

- Separate deployments and connection pools, so analytics cannot take all connections or the memory of the core API
- Budgets inside the analytical database for reports, exports, imports and bid calculation, for example via workload scheduling or resource groups
- An admission limit across all instances: more API pods do not automatically start more heavy queries
- Fair distribution between customers, so one export cannot take the whole analytics capacity
- Cancellations passed through to the database, so nothing keeps computing out of sight

In an asynchronous runtime, a waiting query doesn’t block a whole process. It does hold connections and memory, though. The separation mainly protects availability and resources. It doesn’t reduce the computation itself.

### Who controls what

- Kubernetes

  Places the services on separate server groups, restarts them, rolls out new versions and keeps copies on different hosts via anti-affinity. Workers scale automatically by runnable backlog, for example with KEDA and Prometheus metrics.

- Workflow engine

  Runs multi-step workflows with resumption and distributes work by priority and fairly across customers. Its history only holds references to data, no reports.

- The application

  Decides business order, data version, permissions and how to handle the marketplace quotas. No infrastructure takes that off its hands.

To start, one repository with separately deployable services and worker pools plus a single cluster is enough. You don’t need separate domains or a cluster per customer for that.

## Tested against _real code._

An architecture diagram never argues back. So I ran the design against the real code and against real databases.

- 520

  existing tests from 28 files passed

- 40

  new probe groups, ten of them on real database instances

- 0

  changes to production

One example anyone can follow: the marketplace corrects values for past days after the fact. An architecture that precomputes totals has to be able to replace the old contribution.

One value, four deliveries

Correction

Input 100, then a complete report with 120

Correctly published 120

Unsuitable processing 220

The new complete state replaces 100 with 120. Simply adding counts both deliveries.

Duplicate delivery

Input 100, then 120, then the same 120 again

Correctly published 120

Unsuitable processing 340

If the same correction arrives twice, the state stays the same. Appending blindly gives 100 + 120 + 120.

Report failed

Input State 120, then a failed report

Correctly published 120

Unsuitable processing 0

A failed report replaces nothing. Reading missing values as zero deletes correct numbers.

Confirmed empty

Input State 120, then a complete, explicitly empty report

Correctly published 0

Unsuitable processing 120

A confirmed empty report sets the scope to zero. If old rows aren’t removed, the 120 stays.

Illustration of the tested rules. The 220 was reproduced as a real counter-test on ClickHouse 25.8.

### A correction to my own design

My first draft mostly kept condensed totals. Checking it against the code showed that isn’t enough. Search terms, custom date ranges and year-on-year comparisons need detail data, and a twelve-month report with a year-on-year comparison reads up to two years. So the plan now keeps around 25 months of detail history in the analytical database.

## What growth _would cost._

The cost model calculates a deliberately large scenario: 100 customers, each with the data volume of all of today’s customers combined.

- 791m

  work units per day: 653 million object observations and 138 million report rows

- 30 VMs

  permanently, up to 38 with extra workers for peaks

- about €10,000

  per month net including a 20% buffer, roughly €100 per customer

VMs needed by compute time per work unit

1. 0.5 ms: 27 VMs, of which 5 workers
2. 1 ms: 30 VMs, of which 8 workers (Base assumption)
3. 2 ms: 37 VMs, of which 15 workers
4. 3 ms: 44 VMs, of which 22 workers

The biggest unknown is the compute time per record. It moves the result more than any price list. So it gets measured with real data before any commitment.

The model’s three cases range from €7,705 to €14,867 per month.

Object storage for all copies is only about €53 a month of that. The money goes into compute and reliable workflow orchestration.

A budget estimate with labelled assumptions, using a European cloud provider’s prices from 27 Oct 2026. Development, migration, staff, external data providers and AI usage aren’t included. No load test.

## What the analysis _does not prove._

The result is a solid basis for a decision. Nothing has been migrated yet.

### Proven

- Where the load comes from, with query statistics and references into the code
- That the target design can cover the examined features
- That corrections, duplicates and aborts can be handled with clear rules, at least in a bounded trial
- Which limits the marketplace sets and how to clarify them

### Still open

- Measured savings and a load test at 100 times the volume
- Identical results from the old and new system across all reports
- Approvals and the quotas actually granted by the provider
- Failure, recovery and permission checks across the full system
- Runtime figures of the job server, which could not be accessed during the analysis

### The next step: a narrow, real end-to-end slice

1. Marketplace report
2. Immutable source
3. Correctable facts
4. Published report
5. Frozen bid decision

The bid decision runs without making changes at the provider. The measurements cover changed keys per row read, bytes read and written, compute time, the time to a consistent publication and the duration of a full recovery.

## What other teams _can take from this._

1. ### Working is not proof

   Green tests and happy customers show that the software runs today. Whether it carries ten or a hundred times as much only shows when you test for exactly that.

2. ### Ask AI what it won’t tell you on its own

   An assistant answers the question you ask. Ask explicitly about load, growth and operations, and have the answer checked.

3. ### Measure before you rebuild

   At 27 GB, the database was small. A rewrite in a faster language or sharding would not have removed any of the bottlenecks found.

4. ### Separate early what grows differently

   Sign-in, everyday use, analytics and background work grow at different speeds. Once they’re separate, each part can scale by its own bottleneck.

5. ### Check before growth arrives

   An analysis before growth can be planned. A rebuild under load cannot.

### Your product works. Does it hold up?

In the tech check, I read your code and review architecture, data model, access control and operations. You get in writing what holds and what is needed before the next step.

[Book an intro call](https://www.alexander-hirschfeld.de/en?offer=technik-check#contact) · [See all services](https://www.alexander-hirschfeld.de/en#services)

[Next case study Update deployed. Cache empty. A distributed cache for the moment Kubernetes replaces every container.](https://www.alexander-hirschfeld.de/en/case-studies/cache-under-load)

## Sources and background

- [Martin Kleppmann: Turning the database inside-out (2015)](https://martin.kleppmann.com/2015/03/04/turning-the-database-inside-out.html)
- [Kleppmann, Riccomini: Designing Data-Intensive Applications, 2nd edition](https://www.oreilly.com/library/view/designing-data-intensive-applications/9781098119058/)
- [ClickHouse: Incremental Materialized Views](https://clickhouse.com/docs/concepts/features/materialized-views/incremental-materialized-view)
- [Apache Iceberg: Reliability](https://iceberg.apache.org/docs/latest/reliability/)
- [DuckDB 2.0](https://duckdb.org/2026/10/21/announcing-duckdb-200)
- [StarRocks: Primary Key Table](https://docs.starrocks.io/docs/table_design/table_types/primary_key_table)

Anonymised: product, customer and provider names have been removed. All figures come from the analysis of 27 and 28 October 2026 and from the project’s version history.

As of 28 October 2026
