NewsCrawler.org

WebDB: a lightweight relational database and ORM for the browser

WebDB is a relational database with an optional ORM[1] for web browsers. Its core is about 19 KB gzipped and runs as WebAssembly (WASM)[2], with a Pure JS engine as a fallback when WASM is blocked. Data is saved asynchronously to IndexedDB[3] or OPFS[4], and the project says it works without COOP/COEP server headers.

Queries are type-safe, and live queries update components in React, Vue 3, Angular and plain JavaScript, including across open browser tabs. Search supports typo tolerance and prefix autocomplete over existing tables. Transactions support nested savepoints, and a database can be exported as a .webdb.gz snapshot and inspected with the npx webdb CLI.

The author says the WASM engine outperforms SQLite WASM in all 6 tested workloads, and the Pure JS engine beats it in 4 of 6. The author also says WebDB is about 95% smaller than desktop SQLite and PGlite ports.

Read the original webdb.devDiscussion

Sources

  • webdb.dev

    Author: u/amd__

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

    4 comments

Published: First seen: Читать по-русски

Open as a page