Postgres
-
pgvector vs sqlite-vec: You Probably Don't Need Postgres
Whenever I start looking into vector search, I always end up finding information on pgvector. It’s totally worth considering, especially if you already have Postgres. But there are situations where it might be overkill. And in those situations,
sqlite-vec(the successor tosqlite-vss) is quietly becoming the better answer.When SQLite Wins
Local-first apps and CLI tools. If your thing runs entirely on a user’s machine, a personal knowledge base plugin, a developer CLI, a desktop app, running a full Postgres instance is a huge ask.
sqlite-vecgives you a vector store as a single.dbfile sitting next to your markdown or code. Zero configuration. No background daemon. No port management. It’s just there.Edge computing. On Cloudflare Workers or Vercel Edge Functions, cold starts matter. Establishing a connection to a remote Postgres database, even with a connection pooler, adds latency you feel. SQLite can be bundled with your app or mounted as a local read-only resource. Near-instant access to embeddings.
Testing. Spinning up a Postgres container just to verify your vector search logic adds seconds to every test run. With
sqlite-vec, you initialize an in-memory database, run your tests, and discard it in milliseconds. If you care about fast inner loops, might be the right solution.Single-user scenarios. Building a personal RAG system for your own research? A private publishing pipeline? The complexity of managing Postgres users, permissions, and backups is unnecessary. A single file on disk is easier to back up (just copy it) and easier to reason about.
The Actual Trade-offs
There are real differences and here is what I found.
Feature sqlite-vecpgvectorDeployment Library (embedded) Server (process/container) Configuration Zero High Portability Single file Database dump/restore Concurrency One writer Multi-user Ecosystem Focused vector ops Full relational SQL pgvectorhas better memory management, using the Postgres buffer cache and background workers.sqlite-vecruns in-process, so a large vector index competes directly with your application’s memory. And Postgres has decades of refinement on indexing strategies, JSONB joins, and all the relational features you’d expect.If you’re not using those features, you’re paying for complexity you don’t need. If you prefer lightweight tools over heavy infrastructure,
sqlite-vecjust gets out of the way. There’s nodocker composefile required to start your day. The database is just there when your binary runs.Pick the Right One
The decision is probably easier than you would think.
If you have multiple users writing concurrently, need complex relational queries alongside your vectors, or are already running Postgres, use
pgvector. It’s battle-tested and the ecosystem is deep.If you’re building something local-first, single-user, edge-deployed, or just want fast tests without container overhead, reach for
sqlite-vec. You’ll spend less time on infrastructure and more time on the actual problem.Not every vector search needs a database server.
I’d appreciate a follow. You can subscribe with your email below. The emails go out once a week, or you can find me on Mastodon at @[email protected].
/ Sqlite / Development / Postgres / Vector-search / Pgvector