Skip to content
STACK IT FAST

Qdrant

Curated OSSClassicVector Similarity Search Engine20+ People

Audited from github.com/qdrant/qdrant

Qdrant is an open-source, high-performance vector database and similarity search engine written in Rust for production AI applications.

Language
Rust
Database
RocksDB
Hosting
Docker
License
Apache-2.0
Running for
3 years
Team
20+ People

Why this architecture

Authoring the engine from scratch in Rust provides zero-overhead memory safety, hardware SIMD vectorization, and lock-free concurrency for large-scale similarity search.

Tech stack by layer

5 technologies · audited Sep 17, 2026
Backend & APIs
  • RustCore systems language delivering zero-cost abstractions, memory safety, and SIMD vector math.
  • TokioAsynchronous runtime orchestrating non-blocking network I/O and concurrent segment indexing.
  • gRPCHigh-performance binary transport interface implemented via Tonic in src/tonic.
Data & Persistence
  • RocksDBEmbedded key-value storage engine persisting point metadata, payload indexes, and WAL entries.
Infrastructure & Deploy
  • DockerMulti-stage Dockerfile packaging the optimized Qdrant binary for bare-metal and cloud deployment.

Qdrant architecture diagram

Open SVG
Qdrant architecture diagramClients → REST API (HTTP); Clients → gRPC API (gRPC); REST API → Segments (search · upsert); gRPC API → Segments (search · upsert); Optimizers → Segments (merge); Segments → RocksDB (persist); gRPC API → Cluster peers (replicate)CLIENTSSERVICESWORKERS & JOBSDATA & STORAGEEXTERNALClientsREST · gRPC SDKsREST APIActix WebgRPC APITonicSegmentsHNSW · payload indexOptimizersbackground mergingRocksDBpayloads · WALCluster peersRaft consensusmergeHTTPgRPCsearch · upsertsearch · upsertpersistreplicate
How the main components of Qdrant connect, drawn from the audited repository.
Diagram as text
  • Clients (REST · gRPC SDKs) → REST API (Actix Web): HTTP
  • Clients (REST · gRPC SDKs) → gRPC API (Tonic): gRPC
  • REST API (Actix Web) → Segments (HNSW · payload index): search · upsert
  • gRPC API (Tonic) → Segments (HNSW · payload index): search · upsert
  • Optimizers (background merging) → Segments (HNSW · payload index): merge
  • Segments (HNSW · payload index) → RocksDB (payloads · WAL): persist
  • gRPC API (Tonic) → Cluster peers (Raft consensus): replicate

Key architectural decisions

5 decisions
  1. 01

    Modular segment architecture with background index merging

    Qdrant splits collections into immutable and appendable segments (lib/segment). New points write to appendable segments with a WAL, while background vacuum routines optimize and compile immutable HNSW graphs.

  2. 02

    Dual-protocol serving through Actix Web and Tonic gRPC

    The engine exposes identical vector search and point management APIs across REST (src/actix) and high-throughput gRPC (src/tonic), allowing web frontends and microservices to integrate flexibly.

  3. 03

    Hardware-accelerated SIMD vector distance calculation

    Distance calculations (Dot product, Cosine, Euclidean, Manhattan) leverage CPU vectorization instructions (AVX-512, AVX2, NEON) compiled conditionally in Rust to maximize query throughput.

  4. 04

    Raft consensus for distributed horizontal cluster replication

    Distributed clustering and shard state machines are coordinated through Raft consensus in src/consensus.rs, guaranteeing partition tolerance and continuous consistency across nodes.

  5. 05

    Payload-based pre-filtering integrated directly into HNSW traversal

    Unlike traditional systems that post-filter search results, Qdrant traverses HNSW graphs while applying payload attribute filters during the beam search, avoiding recall degradation.

How Qdrant is built

How Qdrant is structured

Qdrant is structured as a modular Cargo workspace written in Rust (Cargo.toml). The repository separates the low-level indexing mathematical kernels from the storage subsystems, distributed consensus mechanics, and network communication layers:

  • lib/segment/: The core mathematical vector indexing engine. It houses distance calculation kernels (Cosine, Dot, Euclidean, Manhattan), scalar and product quantization algorithms, inverted index postings (lib/posting_list), and Hierarchical Navigable Small World (HNSW) graph structures.
  • lib/storage/ and lib/collection/: Manages collections, shard partitioning, memory-mapped vector buffers, point payload schemas, and background segment optimization workers.
  • lib/wal/: Write-Ahead Log implementation ensuring durability across point insertions, updates, and segment compactions before persistence.
  • src/: Application bootstrap, configuration parsing (config/config.yaml), Prometheus metrics collectors, HTTP endpoints via Actix Web (src/actix), gRPC endpoints via Tonic (src/tonic), and Raft distributed consensus (src/consensus.rs).

Frontend

Qdrant does not require a client-side frontend framework within its core repository, focusing instead on headless database serving. It provides an embedded administrative web dashboard served directly through Actix Web routes, allowing developers to inspect collection health, point counts, segment configurations, and test vector similarity queries directly in a browser.

Backend & APIs

The backend is built with Rust using Tokio (tokio in Cargo.toml) as its asynchronous runtime.

Client interaction is served across two concurrent network protocols:

  1. gRPC Interface: Implemented with Tonic (src/tonic/), utilizing Protocol Buffers for typed, high-throughput streaming and low-latency point insertions.
  2. REST HTTP API: Implemented with Actix Web (src/actix/), providing standard JSON payloads for rapid integration, health probes, and OpenAPI documentation generated from openapi/ definitions.

Both interfaces feed into an internal request coordinator that schedules queries across Tokio worker threads. Vector distance calculations are accelerated using architecture-specific SIMD intrinsics (AVX-512, AVX2 on x86_64, and ARM NEON on aarch64), enabling parallel distance evaluation across dense embedding vectors.

Data & persistence

Persistence in Qdrant is optimized around high-dimensional vector representations and accompanying JSON payloads:

  • Segmented Storage: A collection consists of multiple segments. Active write operations append to an in-memory segment with a Write-Ahead Log (lib/wal/). Once a segment reaches a configurable threshold, background optimizer threads freeze it, compute the HNSW graph index, and write the segment to immutable memory-mapped files on disk.
  • Embedded Storage Engine: Metadata, point IDs, and payload inverted indexes are persisted using RocksDB (rocksdb in Cargo.toml), ensuring fast point lookups and transactional safety during write operations.
  • Quantization: To reduce RAM requirements, Qdrant includes scalar, product, and binary quantization engines (lib/quantization). Quantization compresses 32-bit floating-point vectors into 8-bit or 1-bit representations, reducing memory footprint by up to 95% with minimal impact on search recall.

Build, test & deploy

The build and continuous integration pipeline relies on Rust tooling:

  • Testing: Test suites execute with cargo nextest (.config/nextest.toml), running unit tests in lib/segment, integration suites in tests/, and distributed consensus tests across mock clusters.
  • Linting: Code quality is verified using cargo clippy (clippy.toml) with strict denials on unsafe code patterns and performance regressions.
  • Containerization: The production Dockerfile uses multi-stage builds on Debian or Alpine Linux, producing a compact, statically compiled runtime container.

Self-hosting notes

Running Qdrant in production requires straightforward infrastructure:

  1. Deploy the official Docker container (qdrant/qdrant) or bare-metal binary.
  2. Mount a persistent volume at /qdrant/storage to preserve collections, WAL logs, and snapshots.
  3. Expose port 6333 for the HTTP REST API and port 6334 for the high-throughput gRPC interface.
  4. In distributed production environments, configure cluster nodes with --uri and discovery flags; the built-in Raft engine (src/consensus.rs) handles leader election and shard rebalancing automatically without external ZooKeeper or Consul dependencies.

What to copy (and what not to)

Architectural patterns to emulate from Qdrant:

  • Filtered vector search via index traversal: Evaluating metadata filters during HNSW graph traversal rather than pre-filtering or post-filtering preserves search recall and ensures low latency even when filters match only a small fraction of points.
  • Dual REST and gRPC interfaces: Providing identical domain functionality across both REST and gRPC enables high-throughput microservice architectures without sacrificing developer accessibility.
  • Quantization and memory-mapping: Utilizing memory-mapped files combined with vector quantization allows systems to operate beyond physical RAM limits without incurring severe disk I/O bottlenecks.

Avoid building custom Raft consensus engines into your database if standard external consensus services (or managed databases) already exist in your stack, as maintaining distributed state machine edge cases requires substantial continuous engineering investment.

Sources & repo audit

Audited
Sep 17, 2026
Commit
6ab21ca
License
Apache-2.0

Independent analysis of repository at github.com/qdrant/qdrant. Spotted an inaccuracy? Use the claim form to request a correction.

Show this stack on your README or website
Tech stack of Qdrant
[![Tech stack of Qdrant on STACK IT FAST](https://stackitfast.com/badge/qdrant.svg)](https://stackitfast.com/project/qdrant)

Paste it into your README. It shows your current stack and links to this page.

Use this stack

Scaffold it with your agent

Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Qdrant's architecture.

  1. 1Copy the promptThe full markdown spec, with every layer and decision.
  2. 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
  3. 3Paste and scaffoldUse it as the first instruction; review before you ship.
use-this-stack.md · 58 lines · 5.7 KB
# MISSION: Scaffold "Qdrant" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Qdrant**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Qdrant
- **What It Does**: Qdrant is an open-source, high-performance vector database and similarity search engine written in Rust for production AI applications.
- **Domain & Category**: Vector Similarity Search Engine
- **Production Scale**: 20+ People
- **Development Mode**: CLASSIC
- **Architectural Rationale**: Authoring the engine from scratch in Rust provides zero-overhead memory safety, hardware SIMD vectorization, and lock-free concurrency for large-scale similarity search.
- **Live Website Reference**: https://qdrant.tech
- **Source Repository**: https://github.com/qdrant/qdrant
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Rust, Tokio, Docker, gRPC, RocksDB
- **Primary Language(s)**: Rust, Python, Shell
- **License of the reference repo**: Apache-2.0
- **Backend & APIs**: Rust — Core systems language delivering zero-cost abstractions, memory safety, and SIMD vector math.; Tokio — Asynchronous runtime orchestrating non-blocking network I/O and concurrent segment indexing.; gRPC — High-performance binary transport interface implemented via Tonic in src/tonic.
- **Data & persistence**: RocksDB — Embedded key-value storage engine persisting point metadata, payload indexes, and WAL entries.
- **Infrastructure & deploy**: Docker — Multi-stage Dockerfile packaging the optimized Qdrant binary for bare-metal and cloud deployment.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/qdrant/qdrant @ 6ab21ca)
1. **Modular segment architecture with background index merging**: Qdrant splits collections into immutable and appendable segments (lib/segment). New points write to appendable segments with a WAL, while background vacuum routines optimize and compile immutable HNSW graphs.
2. **Dual-protocol serving through Actix Web and Tonic gRPC**: The engine exposes identical vector search and point management APIs across REST (src/actix) and high-throughput gRPC (src/tonic), allowing web frontends and microservices to integrate flexibly.
3. **Hardware-accelerated SIMD vector distance calculation**: Distance calculations (Dot product, Cosine, Euclidean, Manhattan) leverage CPU vectorization instructions (AVX-512, AVX2, NEON) compiled conditionally in Rust to maximize query throughput.
4. **Raft consensus for distributed horizontal cluster replication**: Distributed clustering and shard state machines are coordinated through Raft consensus in src/consensus.rs, guaranteeing partition tolerance and continuous consistency across nodes.
5. **Payload-based pre-filtering integrated directly into HNSW traversal**: Unlike traditional systems that post-filter search results, Qdrant traverses HNSW graphs while applying payload attribute filters during the beam search, avoiding recall degradation.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
   - Structure as a Turborepo monorepo with strict package boundaries:
     - `apps/web`: Application UI, routing, layouts, and server endpoints.
     - `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
     - `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
     - `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
   - Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
   - Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
   - Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
   - Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
   - Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
   - Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
   - Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (RocksDB): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.
Scaffolded something with this prompt?
Would you pick this stack for a vector similarity search engine project?

Frequently asked about Qdrant

What is Qdrant built with?

Qdrant is written in Rust using Tokio for async execution, Tonic for gRPC, Actix for REST, RocksDB for payload storage, and custom SIMD-optimized HNSW graph algorithms.

How does Qdrant handle large vector collections without exhausting RAM?

Qdrant uses memory-mapped (mmap) file storage for vectors and payload indexes, allowing operating systems to cache hot pages dynamically while keeping billions of embeddings on disk.

Does Qdrant support distributed clustering?

Yes. Qdrant features a built-in Raft consensus engine (src/consensus.rs) that coordinates sharding, replica failover, and snapshot transfers without external orchestration tools.

What protocols does Qdrant support for client communication?

Qdrant provides dual interfaces: HTTP/1.1 REST endpoints via Actix Web and high-throughput binary RPC via gRPC (Tonic).

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

use-this-stack.md