Skip to content
← all writing
// scaling

The client that gives

We onboarded a client with an unusual shape: they wouldn’t send many bills, but the bills they did send carried thousands of line items each.

We weren’t built for that. Loading a bill with that many line items surfaced a whole range of issues, and it became a crash course in scaling the front end — getting React to render everything smoothly in both the display and the edit views.

On the front end, I found the editor was hydrating with the entire bill when it only needed a slice to edit. I stood up a new endpoint that returns just what the editor actually uses.

On the back end, I decoupled the joins so they ran separately from the line items, then streamed the line items in with IAsyncEnumerable, appending them back onto the Bill as they arrived.

Takeaway Scale problems are usually shape problems. Send less, stream the rest, and don't make the user wait on data they aren't looking at yet.