Client Persistence Layer
Where should thousands of cached chat messages and an offline outbox live?
Pros
- Asynchronous non-blocking API handling hundreds of MBs + compound indexes `(chatId, timestamp)`.
- Safe across tab refreshes without blocking the main UI thread.
Cons & Pitfalls
- More verbose API (wrap with tiny helper or `idb`).
Interview Rule of Thumb: Pick IndexedDB for offline chat history, media caches, and durable outboxes.