Back to blog
ResearchFeb 5, 2026·12 min read

Building a Vector Database from Scratch: Architecture Decisions

Deep dive into the architecture of Glacier DB. Learn about our approach to distributed vector search, indexing strategies, and performance optimization.

Vector databases are essential infrastructure for modern AI applications. We're building Glacier DB to address performance and scalability challenges we've encountered.

Why Build Another Vector Database?

Existing solutions struggle with three problems: high latency at scale, expensive indexing operations, and limited hybrid search capabilities. Glacier DB tackles each of these.

Core Architecture

Glacier DB uses a three-tier architecture:

architecture.go
type GlacierDB struct {
  router    *QueryRouter    // Routes queries to shards
  indexer   *VectorIndexer  // HNSW-based indexing
  storage   *ShardedStorage // Distributed storage
  cache     *VectorCache    // Hot vector cache
}

Query Router

Intelligent query routing based on vector characteristics. Uses learned heuristics to predict which shards contain relevant vectors.

Vector Indexer

Modified HNSW (Hierarchical Navigable Small World) graphs with dynamic layer optimization. Achieves 95%+ recall with sub-50ms latency.

Sharded Storage

Horizontal scaling through consistent hashing. Each shard maintains its own index and can handle queries independently.

Performance Results

Benchmarks against 10M vector dataset:

• Query latency: 45ms p95
• Indexing throughput: 50K vectors/second
• Memory usage: 60% reduction vs baseline
• Recall@10: 96.3%

Glacier DB is still in research phase, but early results are promising. We're planning an alpha release for Q2 2026.