r/javascript • • 1d ago

I built WebDB – a lightweight relational database and ORM made natively for the browser

https://webdb.dev/
6 Upvotes

4 comments sorted by

View all comments

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:

  1. Writing endless boilerplate around raw IndexedDB just to get basic joins, filtering, and schema changes.
  2. 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 BroadcastChannel for cross-tab sync, plus NodeFsStorage so 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/webdb
  • GitHub: [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!