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.
But the thing this uncovered for me was scaling. It made me think in a whole new way. Every table can support a hundred items, every React list can support 100-200. What happens though when 2000 are sent over at the same time? This one simple realization started spilling over a new paradigm, that supported how to handle load.