r/javascript • u/amd__ • 1d ago
I built WebDB – a lightweight relational database and ORM made natively for the browser
https://webdb.dev/
9
Upvotes
3
u/shrimpcest 1d ago
Well, your website doesn't fully load, for starters. (I'm on mobile, so I can't easily see the console to give you more details).
None of the text in the page loads though.
EDIT: It was because my phone was in dark mode. This is a bad sign for the rest of your work though :/
2
u/amd__ 1d ago
Hey everyone,
I’ve been building WebDB, an MIT-licensed relational database designed from the ground up for the web.
Why I built it: Whenever I worked on offline-first web apps, I felt stuck between two options:
Writing endless boilerplate around raw IndexedDB just to get basic joins, filtering, and schema changes.
Shipping a multi-megabyte desktop database compiled to WASM that treats the browser like a foreign OS.
I wanted a small, fast relational engine that actually embraces native browser APIs instead of abstracting them away under heavy layers.
What WebDB brings to the table:
Built-in TypeScript ORM: Define clean models, relationships, and typed queries out of the box—no third-party ORM wrapper needed.
Native browser integration: Built directly around modern web standards like OPFS (Origin Private File System), IndexedDB, Web Workers, and
BroadcastChannelfor cross-tab sync, plusNodeFsStorageso your tests and CLI tools run the exact same engine in Node.Dual cores: Choose between a fast Wasm (C) core and a zero-Wasm pure JS core.
Live queries: Subscribe to queries and update your UI automatically when underlying data changes.
Typo-tolerant full-text search: Built-in fuzzy search without pulling in a separate search library.
Complete workflow: Schema migrations, nested transactions, fast bulk inserts, and a CLI tool.
Links:
Website & docs: https://webdb.dev/
Install:
npm install @ahmadmoussawi/webdbGitHub: [Link to repo]
I’d really appreciate any feedback on the ORM ergonomics, storage backends, or benchmarks you’d like to see. Happy to answer any questions about how the engine works under the hood!