Scalable Qdrant vector database cluster with Docker Compose, monitoring, and comprehensive documentation for high-performance similarity search applications.
Qdrant Multi-Node Cluster
Scalable vector database deployment for efficient similarity search across multiple nodes
๐ Overview
This project demonstrates a scalable, distributed deployment of Qdrant, a high-performance vector database. It showcases how to set up multiple Qdrant nodes in a clustered configuration, enabling efficient vector search operations with high availability and performance.
Qdrant is designed for enterprise-grade vector similarity search, supporting a wide range of use cases:
- Semantic text search: Find documents with similar meaning, not just keywords
- Image similarity: Locate visually similar images
- Recommendation systems: Suggest products, content, or services
- Anomaly detection: Identify outliers in vector spaces
- Chatbot knowledge base: Power semantic retrieval for AI assistants
โจ Key Features
- ๐ Scalable Multi-Node Architecture: Deploy 3+ Qdrant nodes that work as a unified cluster
- ๐ Dynamic Sharding: Distribute vector data across nodes with customizable sharding strategies
- ๐ High Availability: Built-in replication for fault tolerance and continuous operation
- ๐ Monitoring Stack: Integrated Prometheus and Grafana for real-time metrics visualization
- ๐ Python Client Integration: Comprehensive demo application showing cluster interaction
- ๐ณ Docker-Based Deployment: Simple setup using Docker Compose
- ๐ง Detailed Configuration: Extensive options for tuning and optimizing performance
๐ Quick Start
Prerequisites
- Docker and Docker Compose
- Python 3.8+
- Git
Installation
# Clone the repository
git clone https://github.com/Mohitkr95/qdrant-multi-node-cluster.git
cd qdrant-multi-node-cluster
Install the package and dependencies
pip install -e .
Deploy the Cluster
# Start the Qdrant cluster with Prometheus and Grafana
cd deployments/docker
docker-compose up -d
Run the Demo
# Run the demonstration
python src/run_demo.py
Or with custom parameters
python src/run_demo.py --host localhost --port 6333 --points 2000
Access Services
- Qdrant API: http://localhost:6333
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (default login: admin/admin)
๐ Documentation
Comprehensive documentation is available in the docs directory:
- Getting Started Guide
- Architecture Overview
- Configuration Guide
- API Reference
- Performance Tuning
- Troubleshooting
๐ ๏ธ Project Structure
qdrant-multi-node-cluster/
โโโ config/ # Configuration files
โ โโโ grafana.json # Grafana dashboard configuration
โ โโโ prometheus.yml # Prometheus configuration
โโโ deployments/ # Deployment files
โ โโโ docker/ # Docker-related files
โ โโโ docker-compose.yml # Docker Compose configuration
โโโ docs/ # Documentation
โ โโโ api/ # API documentation
โ โโโ guides/ # User guides
โ โโโ images/ # Documentation images
โโโ src/ # Source code
โ โโโ qdrant_demo/ # Main package
โ โ โโโ config/ # Configuration settings
โ โ โโโ core/ # Core functionality
โ โ โโโ utils/ # Utility functions
โ โโโ run_demo.py # Main entry point
โโโ tests/ # Test files
โโโ LICENSE # MIT License
โโโ Makefile # Development commands
โโโ README.md # Project overview
โโโ requirements.txt # Python dependencies
โโโ setup.py # Package setup file
๐ Monitoring and Visualization
This project integrates Prometheus for metrics collection and Grafana for visualization, providing real-time insights into your Qdrant cluster's performance.
๐ Advanced Configuration
Sharding Configuration
Customize sharding to distribute data efficiently:
# In settings.py
SHARD_NUMBER = 4 # Default shard count
Vector Parameters
Configure vector dimensions and distance metrics:
# In cluster_demo.py
client.create_collection(
collectionname=self.collectionname,
vectors_config=models.VectorParams(
size=self.vector_size, # 768 by default
distance=models.Distance.COSINE
),
# ...other parameters
)
Adding More Nodes
Extend the cluster by adding more nodes in docker-compose.yml:
qdrant_node4:
image: qdrant/qdrant:v1.6.1
volumes:
- ./data/node4:/qdrant/storage
depends_on:
- qdrant_node1
environment:
QDRANTCLUSTERENABLED: "true"
command: "./qdrant --bootstrap http://qdrantnode1:6335 --uri http://qdrantnode4:6335"
๐งช Testing
Run the test suite:
# Run all tests
make test
Or directly with Python
python -m unittest discover -s tests
๐ค Contributing
Contributions are welcome! See our Contributing Guide for details on how to get started.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Qdrant for the excellent vector database
- Prometheus and Grafana for monitoring capabilities
- All contributors who help improve this project
๐ง Contact
Mohit Kumar - @Mohitkr95
Project Link: https://github.com/Mohitkr95/qdrant-multi-node-cluster