All articles
Scaling··7 min read

Your app works. That is not the same as it scaling.

Read this one if it was fine and then got worse. Correct at ten records looks identical to correct at fifty thousand, which is why scaling failures ship without anyone making a mistake, and why they are harder to fix than a bug.

Your app is not slow because an AI wrote it. It is slow because nobody decided how much data it should load, and an assistant will not make that decision for you.

This is the gap that catches people after the hard part looks finished. The app works. You used it. Your friends used it. Then real data arrives, and the same code that felt instant becomes unusable, without a single line having changed.

Correct at ten records looks identical to correct at fifty thousand

Here is the failure in its purest form, and it is worth understanding because almost every scaling problem in a generated app is a variation of it.

You ask for a search box with live results. You get one, and it works. What you were not told is that it fires a database query on every keystroke. Typing running shoes is twelve separate queries. With ten test users that is invisible. With fifty thousand it is a denial of service you built yourself and pointed at your own database.

That example comes from a widely shared video on AI-assisted coding, which tells it as a Black Friday outage costing a named sum per minute. The company is not identified and no report is cited, so treat the story as an illustration rather than a documented incident. The technical pattern underneath it, a request fired per keystroke with no debounce, is real, common and easy to verify in your own network tab.

The reason this ships is not carelessness. It is that nothing about the code is wrong. There is no bug to find. The query is correct, the component is correct, the tests pass. The missing piece is a decision nobody made, and the line that captures it best is this one:

He didn't make a bad decision. He never made the decision at all.

· DevForge, Vibe Coding is a Trap

An assistant optimises for the request in front of it. You asked for search. You did not ask for search that holds up at fifty thousand users, because at the time you had none.

Why this is harder to fix than a bug

A bug has a wrong line. Scaling problems are usually correct lines doing too much work, which means you cannot find them by reading for mistakes. You find them by understanding what the system does under load, and that is precisely the understanding you skipped.

Brian Kernighan wrote the sentence that governs this, decades before any of it:

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

· Brian Kernighan, The Elements of Programming Style

Substitute as cleverly as possible with by an assistant, faster than you can read it and the conclusion holds. Code you did not reason through is code you cannot reason about when it breaks. The problem is not that AI wrote it. The problem arrives later, when something misbehaves under conditions you never considered and you have no mental model to search.

This is why scaling failures feel so much worse than normal bugs. You are debugging a system and learning it at the same time, usually while it is on fire.

Five patterns that fix almost all of it

The encouraging part is that the remedies are well established and you can ask for them by name. These come from a demonstration by Amichay Even Chen, built on a board holding thousands of records. It is vendor content, so the platform is theirs, but the patterns are not specific to any stack.

One. Show results as they arrive, not when everything is ready. A spinner that waits for a complete response makes the slowest part of your query the speed of your whole app. Render what you have, progressively. Totals and counts can usually be computed by the database far faster than the rows themselves, so ask for aggregates first and fill in detail behind them. Most of what users call speed is actually the absence of waiting with nothing on screen.

Two. Load less of it. Pagination, or infinite scroll if that suits the interface better. Twenty rows now and twenty more on request beats a thousand rows nobody scrolls to. The naive instruction, load all the items then show them to me, is the single most common shape in generated data code, and it is fine right up until it is catastrophic.

Three. Load fewer columns. This one gets overlooked because it is invisible in the interface. Requesting seven fields per row is measurably slower than requesting two, and most list views display two. Fetch what the list shows, then fetch the rest of a record when somebody opens it.

Four. Filter by default, not on request. Real datasets fill up with things nobody looks at: tasks completed months ago, leads untouched for years. If the default view excludes them, most users never wait for them. Add a deliberate way to see everything, and let the rare case be the slow one rather than every case.

Five. Cache, with a deliberate expiry.When you genuinely need all of it, you do not need to fetch all of it again on every refresh. Keep a local copy, show it immediately, and sync in the background. This suits data that changes slowly and is wrong for anything that must be live, so the decision is yours to make rather than your assistant's.

Each of these is a sentence in a prompt. The reason they are missing from your app is not that they are hard. It is that nobody asked.

Finding the problem before your users do

You do not need load-testing infrastructure to catch most of this. You need realistic data and the network tab.

  • Seed your development database with roughly the amount of data you expect in a year, not the eleven rows you have been testing with. Most scaling problems are invisible below a few thousand records and obvious above them.
  • Open the network tab and use the app normally. Count the requests. A single interaction firing a dozen calls is the per-keystroke pattern, and you will see it immediately.
  • Look at response sizes, not just timings. A list view returning hundreds of kilobytes is returning fields nobody is reading.
  • Watch for one request per row. That shape, a list query followed by a call for each item it returned, is the most common generated inefficiency after missing pagination.

What to do about code you do not understand

There is an honest answer here that is less bleak than the one usually offered, which is that you should have written it yourself.

You do not need to understand every line of your application. You do need to understand the parts that decide how much work happens: where data is fetched, how much of it, how often, and what triggers it. That is a much smaller surface than the whole codebase, and it is where essentially all scaling behaviour lives.

So pick the three or four places your app talks to its database and actually read them. Ask what happens when this table has a hundred thousand rows. Ask what triggers this and how often it fires. You are not auditing the code, you are recovering the decisions that were made on your behalf.

Useful instruction when you do this: ask your assistant what happens at scale, not whether the code is correct. Correct is the answer you will always get, and it is true, and it is not the question.

The short version

A demo and a system are different objects. The demo proves the idea. The system survives the data. Moving between them is not a rewrite, it is a handful of decisions about how much work to do and when, and every one of them can be asked for in plain language.

Make those decisions deliberately now, while nobody is using the thing, rather than at three in the morning when everybody is.

Find out which of those apply to you

Fourteen questions, about three minutes, runs entirely in your browser. You get a ranked list of what's actually open, with the fix for each.

Run the free check

Sources

Quotations from the two interviews are transcribed from the published videos and lightly condensed for readability.