Sitemap

Millions of Rows. Zero Patience

3 min readMay 29, 2025

--

Press enter or click to view image in full size

Imagine opening your web app and waiting… and waiting… for millions of rows to load in your browser. Your users feel the same frustration — slow, clunky, and often unusable. The truth? Browsers just aren’t made to swallow such vast amounts of data all at once. And neither are users.

So how do we serve massive datasets without losing performance, usability, or sanity?

The Data Dilemma

We all know the story: you have a huge backend database filled with millions of records. Naturally, the instinct is to show all of it to the user — after all, it’s all valuable, right?

Not quite.

Users want to find insight, not drown in raw data. Browsers don’t have infinite memory. And even the best virtualization tricks won’t save you if your app holds millions of rows in memory.

The Classic “Load It All” Mistake

Virtualization libraries like AG Grid help render only visible rows, which is great — but they still require the entire dataset loaded client-side, somewhere. That’s often hundreds of megabytes or more, which:

  • Bloats browser memory
  • Slows down UI responsiveness
  • Risks crashes or freezes

Your users’ patience? Gone.

Smarter by Design: The “Show Me What I Need” Approach

The key is shifting from “send all data” to “send what the user needs, when they need it.” Here’s how:

1. Server-Side Pagination and Filtering

Instead of bulk-loading millions of rows, load just a page at a time from the server — complete with filters and sorts applied backend-side. Your frontend asks for the specific slice of data the user is viewing. This is the bread and butter for scalable grids.

2. Aggregations First, Details Later

Show summaries and rollups upfront: totals, averages, top categories. Then let users drill down step-by-step into the details. This reduces data transfer and makes information digestible.

3. Search-Driven Interfaces

Let users search or filter first before presenting data. Like Gmail, they don’t see every email at once — just what matches their query. This dramatically cuts down data volume.

4. Real-Time Streaming for Live Data

For use cases such as logs or sensor feeds, stream data incrementally using WebSockets or server-sent events. But beware: even streams can overwhelm if not limited or paged wisely.

5. Export When Needed

Sometimes users really need the full dataset. Provide robust export options instead of trying to render everything in-browser.

Tech Stack Tips

  • Use AG Grid’s Server-Side Row Model for big tables
  • Build backend APIs with filtering, sorting, and pagination
  • Employ caching and materialized views to speed up queries
  • Explore analytics databases like ClickHouse for heavy aggregations
  • Design your UI to guide users — summaries, search bars, filters

Quick Decision Guide: Which Approach Fits Your Use Case?

Press enter or click to view image in full size

Wrap Up

Handling millions of rows isn’t about brute force. It’s about thoughtful design that respects the limits of browsers and the needs of users.

Remember:

Millions of Rows. Zero Patience.

Serve your data smartly, and keep your users happy.

--

--

Bharat Mane
Bharat Mane

Written by Bharat Mane

I am a photographer, a runner, a cyclist, and an aspiring storyteller who happened to fall in love with coding and have the desire to be proud of what I do.