Database / ChromaDB Interview Questions
How does ChromaDB compare to FAISS, and when should you choose one over the other?
FAISS (Facebook AI Similarity Search) and ChromaDB both store and search embedding vectors, but they are designed for very different use cases. FAISS is a low-level library optimised for raw performance; ChromaDB is a higher-level database designed for developer ergonomics and full-stack AI applications.
| Feature | ChromaDB | FAISS |
|---|---|---|
| Type | Vector database (full-stack) | Vector index library (low-level) |
| Storage | Persistent SQLite + HNSW files | In-memory or flat files (manual) |
| Metadata | Built-in key-value filtering | No metadata — must manage separately |
| Documents | Stores original text alongside vectors | Stores vectors only — text management is manual |
| Persistence | Built-in PersistentClient | Manual save/load with faiss.write_index() |
| CRUD | add, get, update, delete, upsert | Add only — no update/delete without rebuilding |
| API | High-level Python + REST | Low-level Python/C++ bindings |
| Performance | Good for <10M docs | Excellent for 10M+ docs (GPU-accelerated) |
| Embedding function | Built-in (auto-embed text) | You must manage embeddings yourself |
| Best for | RAG apps, prototyping, small-medium scale | High-throughput ML systems, research, scale |
# FAISS â lower level, manage everything manually import faiss import numpy as np # Build index manually dim = 384 index = faiss.IndexFlatIP(dim) # inner product vectors = np.random.rand(1000, dim).astype("float32") faiss.normalize_L2(vectors) index.add(vectors) # add vectors D, I = index.search(query_vec, k=5) # search faiss.write_index(index, "index.faiss") # save manually # ChromaDB â higher level, text in, results out import chromadb client = chromadb.Client() col = client.create_collection("demo") col.add(documents=["text one", "text two"], ids=["1","2"]) results = col.query(query_texts=["similar text"], n_results=2) # Embeddings, persistence, metadata all handled automatically
More Related questions...