Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- vector-database
|
| 4 |
+
- benchmarks
|
| 5 |
+
- faiss
|
| 6 |
+
- weaviate
|
| 7 |
+
- chroma
|
| 8 |
+
- multimodal
|
| 9 |
+
- clip
|
| 10 |
+
- retrieval
|
| 11 |
+
license: apache-2.0
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Vector Database Benchmarks: FAISS vs Chroma vs Weaviate
|
| 15 |
+
|
| 16 |
+
This repository contains experiments benchmarking popular vector databases on **multimodal embeddings** generated from the [Flickr8k dataset](https://huggingface.co/datasets/jxie/flickr8k).
|
| 17 |
+
We focused on four key evaluation dimensions:
|
| 18 |
+
|
| 19 |
+
1. **Latency per query**
|
| 20 |
+
2. **Recall@5 vs Flat (accuracy tradeoffs)**
|
| 21 |
+
3. **Queries per second (QPS throughput)**
|
| 22 |
+
4. **Ingestion scaling performance**
|
| 23 |
+
|
| 24 |
+
All experiments were run on **Google Colab** (T4 GPU for embedding generation, CPU backend for databases).
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## Methodology
|
| 29 |
+
|
| 30 |
+
- Dataset: 6k images and 30k captions from Flickr8k.
|
| 31 |
+
- Embeddings: CLIP (OpenAI ViT-B/32).
|
| 32 |
+
- Workload: Caption-to-image retrieval (cross-modal).
|
| 33 |
+
- Baseline: FAISS Flat index used as the ground-truth for recall calculations.
|
| 34 |
+
|
| 35 |
+
Each vector database was tested under the same conditions for ingestion, search, and recall.
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## Results Summary
|
| 40 |
+
|
| 41 |
+
| Metric | FAISS | Chroma | Weaviate |
|
| 42 |
+
|--------------------------|------------------|------------------|------------------|
|
| 43 |
+
| **Avg Latency per Query** | 0.19 ms | 0.76 ms | 1.82 ms |
|
| 44 |
+
| **Recall@5 (Flat Baseline)** | 1.00 | 0.002 | 0.918 |
|
| 45 |
+
| **QPS Throughput** | 1929.94 | 719.01 | 598.40 |
|
| 46 |
+
| **Ingestion Scaling (20k)** | 0.024s | 2.806s | 4.000s |
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## Key Takeaways
|
| 51 |
+
|
| 52 |
+
- **FAISS** is fastest, leveraging in-memory array ingestion and customizable indexing strategies.
|
| 53 |
+
- **Chroma** offers simplicity and ease of integration but struggles at scale due to batching and internal constraints.
|
| 54 |
+
- **Weaviate** provides a more feature-rich ecosystem (schema, hybrid search, persistence) but at higher ingestion and query overhead.
|
| 55 |
+
|
| 56 |
+
At the million-vector scale, speed alone will not decide your choice; **engineering tradeoffs, developer productivity, and system features** will.
|
| 57 |
+
Benchmarks tell one part of the story, your use case tells the rest.
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## Usage
|
| 62 |
+
|
| 63 |
+
You can reproduce these experiments using the provided notebook and Hugging Face dataset.
|
| 64 |
+
See full code here: [rag-experiments/VectorDB-Benchmarks](https://huggingface.co/rag-experiments/VectorDB-Benchmarks).
|
| 65 |
+
Dataset used: Flickr8k (train split — 6k images, 30k captions, multimodal — images and text), CLIP Embeddings. Author: Johnathan Xie
|
| 66 |
+
|
| 67 |
+
All tests run on Google Colab (T4 GPU, CPU backend for DBs).
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
## Citation
|
| 72 |
+
|
| 73 |
+
If you find this useful, please cite this repository:
|
| 74 |
+
|