Date: 2025-05-14
Time: 12:30–12:55
Room: Breakout Room 1
Level: Intermediate
This talk introduces our investigations into creating a lightweight WASM build of Postgres. It covers our objectives for the project and how we approached the work. It talks through some of the challenges we faced, lessons we've learned and opportunities we see for future optimisations and potential upstreaming. Our aim was to create a lightweight, pure WASM build of Postgres, with persistence in both the browser and server-side JavaScript environments (Node, Bun and Deno). We were able to create a <3MB build with support for reactivity, sync and dynamic extension loading. The work is open source and documented at https://pglite.dev The talk walks through our approach to building PGlite, including modifying single user mode to support the wire protocol, unwinding the main event loop and enabling features like pg_notify, RLS and event triggers. It goes into some depth on the key challenges of persistence and extension loading. Including building support for popular extensions like pgvector and PostGIS. We talk about next steps for the work and opportunities like storage abstraction and modularisation, that could help optimise this type of lightweight, embeddable build in future.
This talk could be either 55 or 25 minutes.