We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Web Content Delivery
Free preview: the first 2 parts of this 8-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Web Content Delivery
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Open Google Docs on a plane. No wifi. You can still read your documents, edit them, create new ones, and reorganize your folders. When you land and reconnect, every change syncs automatically to Google's servers.
Where is your data while you are offline? It is in IndexedDB, a real database that lives inside your browser. Google Docs stores the full content of your recent documents in IndexedDB so you can work without any network connection. When you reconnect, the local changes are diffed against the server state and merged.
IndexedDB is not a toy. It stores gigabytes of structured data with indexes, transactions, and cursor-based queries. It powers offline modes in Google Docs, Figma, Notion, Excalidraw, and Spotify's web player. If your app needs to work offline or cache large datasets client-side, IndexedDB is the only browser API with enough capacity and structure to handle it.
Browsers offer several storage options. Each fits a different use case.
localStorage is a synchronous key-value store limited to about 5MB. It stores only strings. Reading or writing blocks the main thread. Fine for saving a theme preference or a token. Terrible for storing 10,000 product records.
sessionStorage is identical to localStorage but clears when the tab closes. Useful for one-time form data or wizard state that should not persist.
Cache API stores request/response pairs. It is designed for service worker caching of network requests, not for application data. You store a Response object keyed by a Request URL. Good for API responses, bad for querying structured data.
IndexedDB is a transactional, indexed, object store. It is asynchronous (never blocks the main thread), stores structured JavaScript objects (no JSON.stringify needed), supports indexes for fast lookups, and handles gigabytes of data. Firefox allows up to 50% of the disk. Chrome allows up to 80% of the disk per origin.