2025-09-28•7 min read
Backend

When you actually need PGVector instead of dedicated databases

When developers get into vector embeddings, their first instinct is to spin up Pinecone or Milvus. But adding a separate database brings connection issues, data sync lag, and separate security rules.

If your actual metadata lives in PostgreSQL, you have to sync updates to the vector database. When a project is deleted, you must delete its vectors. If the sync fails, you get data drift.

We avoided this by enabling the PGVector extension on PostgreSQL. It allows us to store embeddings directly on our existing tables, query vectors using SQL, and join data atomically. Keep your tech stack simple until you have a real reason to scale.

From a systems perspective, implementing this solution required auditing our telemetry structures. We mapped key transactions across our distributed database queries and evaluated the locking overheads under heavy load. By setting up strict validation rules in Prisma, we isolated runtime query errors before they could trickle up to the client view.

Ultimately, building durable systems means choosing boring abstractions and documenting architectural decisions (ADRs) meticulously. When infrastructure behaves predictably, your team can deploy with high confidence. We enforce these performance and security budgets in our continuous integration (CI) workflows, ensuring that every merge maintains the same standard.

Navigation

Explore more production architectures & case studies.