FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
sql.js + IndexedDB: Building an Offline-First Web App
How-ToTools

sql.js + IndexedDB: Building an Offline-First Web App

via Dev.toRecca Tsai20h ago

Originally published at recca0120.github.io sql.js lets you run SQLite inside the browser with an API that feels nearly identical to the server-side version. But there is a catch I only discovered the first time I used it: close the tab and all your data is gone. The reason is straightforward—sql.js keeps the entire database in memory with no automatic persistence. If you want to build an application that truly works offline and survives a browser restart, you have to handle the storage layer yourself. Why IndexedDB The first instinct is usually localStorage because the API is dead simple. But it has two hard limitations that rule it out: The storage cap is around 5 MB , and exceeding it throws an exception. A SQLite file with any real data can blow past that easily. It can only store strings . sql.js exports a Uint8Array , so you would have to Base64-encode it before writing and decode it back on read. That is extra complexity, and the encoding alone inflates the binary size by roughl

Continue reading on Dev.to

Opens in a new tab

Read Full Article
3 views

Related Articles

How to Prevent Merge Conflicts When Multiple Teams Work in the Same Codebase
How-To

How to Prevent Merge Conflicts When Multiple Teams Work in the Same Codebase

Medium Programming • 19h ago

How One Hour of Planning Makes the Whole Week Feel Easier
How-To

How One Hour of Planning Makes the Whole Week Feel Easier

Medium Programming • 1d ago

Multi‑File Magic: 8 Claude Code Commands for Safe, Large‑Scale Codebase Changes
How-To

Multi‑File Magic: 8 Claude Code Commands for Safe, Large‑Scale Codebase Changes

Medium Programming • 1d ago

What Learning to Code Actually Feels Like (No One Talks About This)
How-To

What Learning to Code Actually Feels Like (No One Talks About This)

Medium Programming • 1d ago

How to Run Ethernet Cables to Your Router and Keep Them Tidy
How-To

How to Run Ethernet Cables to Your Router and Keep Them Tidy

Wired • 1d ago

Discover More Articles