Skip to the content.

Architecture Overview

This document outlines the architecture of the Qdrant Multi-Node Cluster setup, explaining the various components and how they interact to form a cohesive, distributed vector database system.

High-Level Architecture

The system consists of the following primary components:

Architecture Diagram

  1. Qdrant Cluster: Multiple Qdrant nodes working together
  2. Client Application: Python application to interact with the cluster
  3. Monitoring Stack: Prometheus and Grafana for observability

Qdrant Cluster Components

Node Structure

The Qdrant cluster is organized in a bootstrap topology with three main node types:

Clustering Mechanism

Qdrant uses a consensus algorithm for cluster management:

  1. Peer Discovery: Nodes discover each other through the bootstrap node
  2. Consensus Protocol: Ensures data consistency across nodes
  3. Automatic Failover: If a node fails, the cluster continues to operate

Sharding and Replication

The cluster distributes data using these mechanisms:

Data Flow

Write Operations

When vectors are added to the collection:

sequenceDiagram
    participant Client
    participant CoordinatorNode as Coordinator Node
    participant PrimaryShards as Primary Shards
    participant ReplicaShards as Replica Shards
    
    Client->>CoordinatorNode: Upload Vector Data
    Note over CoordinatorNode: Determine shard placement<br>based on vector ID or metadata
    CoordinatorNode->>PrimaryShards: Write to primary shards
    PrimaryShards->>ReplicaShards: Replicate data
    PrimaryShards-->>CoordinatorNode: Acknowledge write
    CoordinatorNode-->>Client: Success response
  1. Client sends vector data to any node in the cluster
  2. The node determines the appropriate shard based on vector ID or metadata
  3. Data is written to the primary shard
  4. Replication ensures data is copied to other nodes

When a search query is executed:

sequenceDiagram
    participant Client
    participant CoordinatorNode as Coordinator Node
    participant Shards as All Shards
    
    Client->>CoordinatorNode: Vector Search Query
    Note over CoordinatorNode: Parse query parameters
    par Query distribution
        CoordinatorNode->>Shards: Distribute query to all shards
        Shards-->>CoordinatorNode: Return local results
    end
    Note over CoordinatorNode: Merge & sort results<br>based on similarity scores
    CoordinatorNode-->>Client: Return final results
  1. Client sends a search request to any node
  2. The coordinator node distributes the query to all shards
  3. Each shard performs local vector search
  4. Results are collected and merged based on similarity scores
  5. Final results are returned to the client

Monitoring Architecture

Metrics Collection

Visualization

Client Application Architecture

The Python client application demonstrates interaction with the cluster:

Configuration Architecture

The system uses a layered configuration approach:

  1. Default Configuration: Base settings defined in code
  2. Environment Variables: Docker-specific settings through environment variables
  3. Command-line Arguments: Runtime customization for the client application

Security Considerations

While this is a demonstration project, in a production environment:

Scalability Aspects

The architecture allows for horizontal scaling:

Future Architecture Enhancements

Potential improvements to the architecture: