← Back to all stories

The Unified Store: Why Dedicated Vector Databases Lost to Columnar and Relational Engines

Imagine a department store where men's shoes are sold on the 3rd floor of the main building, but the shoe boxes and shoelaces are stored in a completely separate warehouse three blocks away. Every time a customer wants to try on a pair of shoes, two staff members must coordinate across a walkie-talkie and execute a synchronized handoff across city traffic. That operational absurdity was the reality of managing isolated vector databases.

The Nightmare of the Dual-Database Architecture

During the early generative AI wave, specialized standalone vector databases emerged. Engineering teams adopted an architecture where user metadata, permissions, and billing lived in PostgreSQL, while document vector embeddings lived in an external vector cloud.

This dual-database pattern introduced severe production failures:

  • Synchronization Lag & Consistency Drift: When a user deleted a document in Postgres, the vector database often lagged, leaving stale embeddings that continued to be retrieved in RAG searches.
  • Two-Phase Commit Complexity: Handling transaction rollbacks across two separate database systems required complex distributed locking mechanisms.
  • Post-Filtering Latency: Performing hybrid queries ('Find documents similar to X created after 2025 by User Y') required fetching 1,000 vector IDs, querying Postgres to filter permissions, and throwing away 95% of the results.
[Isolated Vector DB vs. Unified Relational & Columnar Store]

Isolated Dual-Store Architecture:
PostgreSQL (Metadata & Auth) ◄── (Network Lag & Sync Bugs) ──► Isolated Vector DB
├── Complex Two-Phase Commits
└── Post-retrieval permission filtering destroys search latency!

Unified Engine (ClickHouse / PostgreSQL + pgvector):
┌─────────────────────────────────────────────────────────────┐
│  SINGLE UNIFIED DATABASE (PostgreSQL / ClickHouse)          │
│  ├── Columns: `id`, `user_id`, `created_at`, `permissions`  │
│  ├── Column:  `embedding` vector(1536)                      │
│  └── Integrated SQL:                                        │
│      SELECT title FROM docs WHERE user_id = 42              │
│      ORDER BY embedding <=> query_vec LIMIT 5;              │
└─────────────────────────────────────────────────────────────┘
(ACID compliant, zero sync lag, sub-millisecond pre-filtered retrieval!)

The Power of Unified Vector Engines

Modern relational and columnar databases (such as PostgreSQL with pgvector, SQLite with sqlite-vec, and ClickHouse for billion-scale analytics) integrated vector search natively into their core execution engines:

  1. ACID Guarantees: Vector embeddings are inserted, updated, and deleted in the exact same atomic transaction as the document text and metadata.
  2. True Pre-Filtering: The SQL query planner evaluates relational filter conditions (tenant_id = ? AND status = 'active') directly during index traversal, evaluating vector similarity only on valid matching rows.
  3. Operational Simplicity: Backup, replication, point-in-time recovery, and security policies are managed under a single unified database system.

Engineering Takeaway

Do not add a dedicated vector database to your infrastructure unless you have proven billion-scale throughput needs that cannot be met by your primary database. Unify your vector embeddings inside your existing relational or columnar store for maximum reliability and simplicity.

Reference Paper / Context: pgvector & ClickHouse: Vector Search Meets Relational and Columnar Systems — Read source ↗
👨‍💻
About the Author

I am Vikram Samal, an AI systems architect exploring how intelligent systems reason, adapt, and act—and how to make them reliable at scale. I connect emerging AI capabilities with the architectural decisions that shape performance, trust, and practical value. Through this blog, I share insights into the ideas and engineering choices shaping AI’s next chapter. As a proud father of two, I believe curiosity, human judgment, and continuous learning are essential in a world being transformed by AI.

Previous
← Grading the Journey: How Process Reward Models (PRMs) Replaced Flawed Outcome-Based Evaluation
Next
Down to the Metal: How Unsloth and Custom Triton Kernels Slashed Fine-Tuning Memory by 80% →