Building a Semantic Search API with Spring Boot and pgvector - Part 2: Designing the PostgreSQL Schema
Why the database layer matters
In a semantic search system, the database schema isn’t just storage.
It defines how embeddings are stored, indexed, and queried.
Many tutorials treat the database as a d
klement Gunndu
Agentic AI Wizard
Strong take on keeping embeddings in PostgreSQL instead of a separate vector store. We made the same decision for a document search system — single-transaction writes between documents and their embeddings eliminated an entire class of consistency bugs we had with a Pinecone setup. The tradeoff showed up at around 2M vectors where pgvector query latency started climbing, but HNSW indexing brought it back under 50ms.