Freedom251 › Embedded Databases
PGlite

What PGlite is
PGlite packages Postgres as a WebAssembly build and a TypeScript/JavaScript client library. It runs in browsers, Node.js, Bun, and Deno without requiring other dependencies, and its package is under 3 MB gzipped. Data can remain in memory or persist to IndexedDB in browsers and the filesystem in Node.js or Bun. PGlite supports Postgres extensions such as pgvector and PostGIS, plus live-query primitives for reactive updates when database data changes. Documentation provides hooks for React and Vue and lists compatibility with Prisma, Drizzle, Kysely, Knex.js, Orange ORM, and TypeORM. Described uses include embedded application databases, unit and CI testing, local and remote development, and on-device or edge AI and RAG. PGlite supports data synchronization and is developed by Electric for local or edge embedding, including syncing a subset of server-side Postgres data. It is open source and dual-licensed under Apache 2.0 and the PostgreSQL License. The listed plan costs nothing. PGlite uses one exclusive database connection; a multi-tab worker can share an instance across browser tabs.
Who it suits
PGlite suits developers embedding a relational database in browser, Node.js, Bun, or Deno applications, as well as those working on local development or testing. Its single exclusive connection is worth considering for workloads that need concurrent access.
What it does well
- Runs in browsers, Node.js, Bun, and Deno.
- Package is under 3 MB gzipped.
- Supports Postgres extensions including pgvector and PostGIS.
- Open source with two listed licenses.
What to know first
- Uses one exclusive database connection.
- Socket server behavior differs from a normal Postgres installation.
- Not all socket-server use cases are guaranteed to work.
Limits
PGlite provides one exclusive connection to the database. Its socket server can multiplex connections, but it differs from a normal Postgres installation and does not guarantee every use case.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| PGlite | Open-source software; dual-licensed under Apache 2.0 and PostgreSQL License | Free |
As pglite.dev lists them, read 5 Oct 2026. The maker's own page has the final word.
Getting started
- Open the PGlite website
- Install the TypeScript or JavaScript client library
- Choose a browser, Node.js, Bun, or Deno runtime
- Configure in-memory or persistent storage
- Connect through SQL and optional framework or ORM integrations
- Use a multi-tab worker when sharing an instance across browser tabs
Verdict
PGlite offers a compact way to embed Postgres across several JavaScript runtimes, with persistence options, extensions, and framework integrations. Its connection model and socket-server caveat matter when planning concurrent or server-style use.
Questions
What does PGlite cost?
The listed PGlite plan costs nothing. It is open-source software.
Which platforms does it support?
Supported platforms are browsers, Node.js, Bun, and Deno. It is offered for self-hosted and web use.
Is PGlite open source?
Yes. It is dual-licensed under Apache 2.0 and the PostgreSQL License.
Does it support data synchronization?
Yes. Electric develops it for local or edge embedding, including synchronization of a subset of server-side Postgres data.
Which integrations are documented?
Framework hooks are provided for React and Vue. Compatible ORMs and query builders include Prisma, Drizzle, Kysely, Knex.js, Orange ORM, and TypeORM.
Facts from PGlite's own pages
- Connection limit
- PGlite has a single exclusive connection to the database; the documentation describes a multi-tab worker for sharing an instance across browser tabs. · pglite.dev, 5 Oct 2026
- Extensions
- PGlite supports Postgres extensions including pgvector, and its home page also names PostGIS support. · pglite.dev, 5 Oct 2026
- Framework integrations
- The documentation provides framework hooks for React and Vue. · pglite.dev, 5 Oct 2026
- License
- PGlite is dual-licensed under Apache 2.0 and the PostgreSQL License. · pglite.dev, 5 Oct 2026
- Maker
- PGlite is developed by Electric for embedding into applications locally or at the edge, including syncing a subset of server-side Postgres data. · pglite.dev, 5 Oct 2026
- Maker headquarters
- Electric says it is headquartered in the San Francisco Bay Area. · electric.ax, 5 Oct 2026
- ORM integrations
- The documented compatible ORMs and query builders include Prisma, Drizzle, Kysely, Knex.js, Orange ORM, and TypeORM. · pglite.dev, 5 Oct 2026
- Persistence
- PGlite can run in memory or persist data to the filesystem in Node/Bun and IndexedDB in browsers. · pglite.dev, 5 Oct 2026
- Reactive queries
- PGlite includes live query primitives for reactive updates when underlying database data changes. · pglite.dev, 5 Oct 2026
- Runtime support
- PGlite runs in browsers, Node.js, Bun, and Deno without requiring other dependencies. · pglite.dev, 5 Oct 2026
- Size
- The PGlite package is under 3 MB gzipped. · pglite.dev, 5 Oct 2026
- Socket server caveat
- The PGlite Socket documentation says its server can multiplex simultaneous connections, but notes that this differs from a normal Postgres installation and not all use cases are guaranteed to work. · pglite.dev, 5 Oct 2026
- Use cases
- The documentation describes use for embedded application databases, unit and CI testing, local development, remote development, and on-device or edge AI and RAG. · pglite.dev, 5 Oct 2026
- What it is
- PGlite is a WebAssembly build of Postgres packaged as a TypeScript/JavaScript client library. · pglite.dev, 5 Oct 2026
Where PGlite stands on Freedom251
- Embedded Databases#20 of 30