PGVector vs Pinecone vs Weaviate for Java Backend — When to Pick Each
Fast recall
Quick revision
Core answer
HNSW and ivfflat. Best when your team already runs Postgres. Pinecone is a fully managed serverless vector service — zero ops, auto-scales, but vendor-locked and priced per query/storage. Best for teams who want no vector infra at all. Weaviate is an open-source standalone vector database with built-in vectorization (it can call an embedding model itself during ingest) and a GraphQL/REST API. Best when you need rich filtering, multi-tenancy, or hybrid (keyword + vector) search without managing the embedding step. Spring AI 1.0.0 has first-class support for all three via PgVectorStore, PineconeVectorStore, and WeaviateVectorStore.Whether the candidate can reason about infrastructure trade-offs — not just name the options — and knows when Postgres is enough versus when a dedicated vector store earns its keep
Defaulting to Pinecone because 'it's purpose-built' without acknowledging the vendor lock-in, per-query pricing, and the fact that PGVector handles millions of vectors comfortably with an HNSW index
Mention Weaviate's built-in vectorization modules (text2vec-openai, text2vec-transformers) that skip the separate embedding step. Explain that PGVector's HNSW index keeps p95 search under 10 ms at 1M vectors on modern hardware.
Interview-ready guide
Interview answer
The three differ mainly on operations, not on the core similarity search capability.
PGVector is a Postgres extension. If you already run Postgres, it's the path of least resistance — HNSW index, same transaction boundary as your relational data, no new service to deploy. It handles millions of vectors fine.
Pinecone is fully managed and serverless. Zero ops, auto-scales. The trap candidates miss: you're vendor-locked and paying per query, so a high-throughput production workload can get expensive fast.
Weaviate is open-source with built-in vectorization — configure a text2vec module and it calls the embedding model on ingest. You push raw text; it handles embedding. Strong hybrid search (BM25 + vector) and multi-tenancy make it the right pick for richer data models.
In Spring AI 1.0.0, all three are behind the VectorStore interface, so switching is mostly a configuration change.
PGVector vs Pinecone vs Weaviate for Java Backend — When to Pick Each
Direct Answer
PGVector is a Postgres extension — no new infrastructure, vectors live in the same DB as your relational data, supports HNSW and ivfflat. Best when your team already runs Postgres. Pinecone is a fully managed serverless vector service — zero ops, auto-scales, but vendor-locked and priced per query/storage. Best for teams who want no vector infra at all. Weaviate is an open-source standalone vector database with built-in vectorization (it can call an embedding model itself during ingest) and a GraphQL/REST API. Best when you need rich filtering, multi-tenancy, or hybrid (keyword + vector) search without managing the embedding step. Spring AI 1.0.0 has first-class support for all three via PgVectorStore, PineconeVectorStore, and WeaviateVectorStore.
Common Mistakes & Pitfalls
Defaulting to Pinecone because 'it's purpose-built' without acknowledging the vendor lock-in, per-query pricing, and the fact that PGVector handles millions of vectors comfortably with an HNSW index
Check your understanding
Answer these without looking back at the article.
- How does PGVector's HNSW index compare to ivfflat in terms of build time versus query latency?
- What is Pinecone's serverless pricing model and at what scale does it become expensive?
- How does Weaviate's built-in text2vec-openai module handle embedding during ingest?
- How does Spring AI's VectorStore abstraction make it easy to switch from PGVector to Pinecone?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.