Menu

1 / 4

SQLite for JavaScript bundles, plus a distributed version on Lambda

DEV Community: javascript·Edoardo Dusi·3 days ago
#3mlkfg7h
#devtojavascript#devto#dev#function#every
Long article (3343 words) — no AI summary yet.
Reading 0:00
15s threshold

A JavaScript bundler takes hundreds (sometimes thousands) of modules and turns them into a single file a browser can run. Every bundler you use, webpack and esbuild included, keeps its own little database inside that file: a table of modules, a way to look them up, a cache of what already ran. It just never calls it that!

In August, Farid Zakaria wrote Your executable is a SQLite database , a post arguing that ELF, the format of every Linux binary, is a database that refuses to admit it. I spent a good part of last year on bundlers (because why not ) and gave a talk about how they work at DEVWorld, so obviously I immediately thought: what if a JavaScript bundle admitted it? What if the output of a bundler were a real SQLite file, and linking, tree-shaking and patching were SQL queries?

Ok, you will probably never ship a bundle as a database, and I won't try to convince you to. But SQLite runs almost everywhere and pushing it into a job it was not really meant for is a good way to do a deep dive.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.