~/talk

Compiling Postgres to WASM with PGlite

Talkat PGConf.dev 2025 · 2025-05-13..05-16· [databases, webassembly]
links:none on file
slides:none on file

PG Lite compiles Postgres to WASM using Emscripten, embeds initdb, and replaces forking with single-user mode plus an unwound main loop that avoids syncify, yielding a 6–8x speedup over stack-unwinding. Output serializes to JSON, persistence uses the Emscripten VFS with IndexedDB (browser) and Node/Bun/Deno filesystems, and dynamic extension loading supports pgvector compiled (PostGIS is harder). Result is a <3MB embeddable Postgres with reactive live queries via PG_NOTIFY, real-time sync, and half‑million weekly npm downloads.

AI-written summary · about

  1. 0:00Introduction to PGlight
  2. 1:38Understanding Web Assembly
  3. 2:56The Single User Mode Challenge
  4. 4:13Implementing the Wasm Port
  5. 6:39First Release and Limitations
  6. 7:50Optimizing Performance
  7. 9:36Bootstrapping with initdb
  8. 10:49Live Queries and Reactivity
  9. 12:05Example Application Showcase
  10. 13:07Extensions and Ecosystem
  11. 14:36Real World Adoptions
  12. 16:25PGlight Use Cases
  13. 18:03Future Goals for Libpglite
  14. 19:48Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.