Vector database: chọn đúng cáiVector databases: pick the right one

Đừng hỏi dùng vector DB nào. Hãy hỏi vector nên sống ở đâu.Don't ask which vector DB. Ask where your vectors should live.

Mười hệ trong infographic gốc thuộc ba họ khác nhau. Mỗi bậc dưới đây xa ứng dụng hơn bậc trước một chút, và mỗi bậc có cái giá riêng. Chọn bậc trước, chọn tên sau.The ten systems in the original infographic belong to three different families. Each rung below sits a little further from your application than the one before, and each has its own price. Pick the rung first, the name second.

Vector sống ngay trong tiến trình của bạnVectors live inside your own process

Không lượt gọi mạng, không hệ thống mớiNo network hop, no new system

Vector sống cạnh dữ liệu nghiệp vụ, trong database bạn đang vận hànhVectors live next to your business data, in a database you already operate

Một lượt gọi mạng, không hệ thống mớiOne network hop, no new system

Vector sống trong một dịch vụ riêng chỉ để tìm kiếm vectorVectors live in a separate service built only for vector search

Một lượt gọi mạng và thêm một hệ thống phải đồng bộOne network hop plus one more system to keep in sync

Nét đứt là một lượt gọi qua mạng. Dấu +1 là một hệ thống mới phải vận hành và đồng bộ.A dashed line is a network hop. The +1 badge is one more system to operate and keep in sync.

Chọn cái nàoWhich one to pick

Kiểm tra mốc 'không dùng gì' trước. Chỉ khi nó không đủ mới đi theo cây quyết định.Check the 'use nothing' baseline first. Only when it falls short, follow the decision tree.

Khi nào không cần vector databaseWhen you need no vector database

  • Người dùng tìm bằng từ khoá, mã, tên chính xác: dùng full-text (BM25), ví dụ Postgres FTS hay SQLite FTS5.Users search by keyword, code or exact name: use full-text (BM25), such as Postgres FTS or SQLite FTS5.
  • Toàn bộ tài liệu vừa context window của LLM: đưa thẳng vào prompt, bỏ luôn tầng retrieval.All documents fit in the LLM's context window: put them straight into the prompt and drop retrieval altogether.
  • Dưới vài trăm nghìn vector, một tiến trình đọc: ma trận numpy trong RAM. 100.000 vector 768 chiều chỉ khoảng 300 MB, quét hết mất cỡ vài chục mili giây, kết quả luôn chính xác.Under a few hundred thousand vectors, one reading process: a numpy matrix in RAM. 100,000 vectors of 768 dimensions is about 300 MB, a full scan takes a few tens of milliseconds, and results are always exact.
  • Đã chạy Postgres: pgvector gần như không tính là thêm hệ thống.Already running Postgres: pgvector barely counts as a new system.

Rời mốc này khi p95 vượt ngân sách, cần nhiều tiến trình dùng chung, dữ liệu cập nhật liên tục kèm bộ lọc phức tạp, hoặc không còn vừa RAM một máy.Leave the baseline when p95 exceeds budget, several processes need shared access, data changes constantly with complex filters, or it no longer fits in one machine's RAM.

Cây quyết định 30 giâyThe 30-second decision tree

Bạn thật sự cần tìm theo nghĩa?
├─ Không ─► BM25 / full-text là đủ (Postgres FTS, SQLite FTS5, Elasticsearch)
└─ Có
   │
   Dưới vài trăm nghìn vector, một tiến trình, không cần HA?
   ├─ Có ─► numpy hoặc FAISS Flat; Chroma nếu muốn API tiện
   └─ Không
      │
      Dữ liệu gốc đã nằm trong Postgres, MongoDB, Elasticsearch hay Redis?
      ├─ Có ─► dùng tìm vector của chính DB đó; đo recall và p95 trước khi rời đi
      └─ Không, hoặc đã đo và không đủ
         │
         ├─ Không có ai vận hành server       ─► Pinecone, hoặc bản cloud của Qdrant / Weaviate / Zilliz
         ├─ Truy vấn nào cũng có bộ lọc nặng  ─► Qdrant
         ├─ Từ khoá quan trọng ngang ngữ nghĩa ─► Weaviate; Elasticsearch nếu cần full-text đầy đủ
         ├─ Hàng trăm triệu tới hàng tỷ vector ─► Milvus / Zilliz Cloud
         └─ Cần vài mili giây, dữ liệu vừa RAM ─► Redis
Do you really need search by meaning?
├─ No  ─► BM25 / full-text is enough (Postgres FTS, SQLite FTS5, Elasticsearch)
└─ Yes
   │
   Under a few hundred thousand vectors, one process, no HA needed?
   ├─ Yes ─► numpy or FAISS Flat; Chroma if you want a friendlier API
   └─ No
      │
      Does your source data already live in Postgres, MongoDB, Elasticsearch or Redis?
      ├─ Yes ─► use that database's vector search; measure recall and p95 before leaving
      └─ No, or you measured and it isn't enough
         │
         ├─ Nobody to operate servers            ─► Pinecone, or the cloud tier of Qdrant / Weaviate / Zilliz
         ├─ Every query carries heavy filters    ─► Qdrant
         ├─ Keywords matter as much as meaning   ─► Weaviate; Elasticsearch if you need full-text depth
         ├─ Hundreds of millions to billions     ─► Milvus / Zilliz Cloud
         └─ A few milliseconds, data fits in RAM ─► Redis

Mười hệ, theo ba họTen systems, in three families

Số trên mỗi thẻ chỉ để tra cứu, không phải thứ hạng. Thẻ xếp từ gần ứng dụng nhất tới xa nhất.Card numbers are for reference, not ranking. Cards run from closest to your application to furthest away.

Nhúng / thư việnEmbedded / library

Vector sống ngay trong tiến trình của bạn. Không lượt gọi mạng, không hệ thống mới.Vectors live inside your own process. No network hop, no new system.

01

Chroma

Nhúng / thư việnEmbedded / library

Nhúng, client–server, Chroma CloudEmbedded, client–server, Chroma Cloud

Kho vector cài bằng một lệnh pip, chạy ngay trong script Python.A vector store you install with one pip command and run inside your Python script.

Dùng choUse for
Prototype, demo, test tích hợp.Prototypes, demos, integration tests.
ĐượcYou gain
Chạy được sau một lệnh pip.Working after a single pip install.
MấtYou lose
Không có HA; một node, ghi đồng thời yếu.No HA; single node, weak concurrent writes.

Chọn Chroma là đổi độ bền và khả năng mở rộng của production lấy tốc độ đi từ ý tưởng tới bản chạy được.Choosing Chroma trades production durability and scale for the shortest path from idea to working code.

Dấu hiệu nhận biếtTell-tale sign Nếu mục tiêu tuần này là chứng minh ý tưởng chứ chưa phải phục vụ người dùng thật, Chroma là đủ.If this week's goal is proving an idea rather than serving real users, Chroma is enough.

Ảnh chỉ ghi EMBEDDED. Chroma còn chạy dạng server (HttpClient) và có bản managed Chroma Cloud.The image says EMBEDDED only. Chroma also runs as a server (HttpClient) and has a managed Chroma Cloud.

02

FAISS

Nhúng / thư việnEmbedded / library

Thư viện C++/Python, chạy trong tiến trìnhC++/Python library, runs in-process

Thư viện tìm kiếm tương tự của Meta: rất nhanh, nhưng không phải database.Meta's similarity search library: extremely fast, and not a database.

Dùng choUse for
Nghiên cứu, xử lý lô offline, lõi của hệ tự xây.Research, offline batch jobs, the core of a custom system.
ĐượcYou gain
Tốc độ thô, nhiều loại index nhất, có GPU.Raw speed, the most index types, GPU support.
MấtYou lose
Không lưu trữ, không lọc, không CRUD.No persistence, no filtering, no CRUD.

Chọn FAISS là đổi mọi tiện ích của một database lấy tốc độ thô và toàn quyền kiểm soát thuật toán.Choosing FAISS trades every convenience of a database for raw speed and full control over the algorithm.

Dấu hiệu nhận biếtTell-tale sign Nếu bạn cần một thuật toán chứ không cần một hệ thống, hãy dùng FAISS.If you need an algorithm rather than a system, use FAISS.

Vector trong DB sẵn cóVectors in a DB you already run

Vector sống cạnh dữ liệu nghiệp vụ, trong database bạn đang vận hành. Một lượt gọi mạng, không hệ thống mới.Vectors live next to your business data, in a database you already operate. One network hop, no new system.

03

pgvector

Vector trong DB sẵn cóVectors in a DB you already run

Extension Postgres: tự host hoặc trên hầu hết Postgres managedPostgres extension: self-hosted or on most managed Postgres

Vector nằm ngay trong bảng Postgres, truy vấn bằng SQL.Vectors sit inside your Postgres tables and are queried with SQL.

Dùng choUse for
Ứng dụng đã chạy Postgres, dưới khoảng chục triệu vector.Apps already on Postgres, under roughly ten million vectors.
ĐượcYou gain
Không thêm hệ thống, có transaction và SQL.No new system, transactions and SQL included.
MấtYou lose
Hiệu năng ở quy mô rất lớn, không scale ngang.Performance at very large scale, no horizontal scaling.

Chọn pgvector là đổi hiệu năng đỉnh ở quy mô rất lớn lấy việc không phải vận hành thêm một hệ thống.Choosing pgvector trades peak performance at very large scale for not running another system.

Dấu hiệu nhận biếtTell-tale sign Nếu dữ liệu gốc đã ở Postgres và bạn có dưới khoảng chục triệu vector, hãy bắt đầu từ pgvector.If your source data already lives in Postgres and you have fewer than roughly ten million vectors, start with pgvector.

Ảnh ghi SELF-HOST. Thực tế pgvector có sẵn trên hầu hết Postgres managed: Amazon RDS/Aurora, Google Cloud SQL, Azure, Supabase, Neon.The image says SELF-HOST. In practice pgvector is available on most managed Postgres: Amazon RDS/Aurora, Google Cloud SQL, Azure, Supabase, Neon.

04

Redis

Vector trong DB sẵn cóVectors in a DB you already run

Tự host hoặc Redis CloudSelf-hosted or Redis Cloud

Tìm vector trong RAM, độ trễ tính bằng mili giây.Vector search in RAM, with latency measured in milliseconds.

Dùng choUse for
Semantic cache, gợi ý real-time, tập dữ liệu vừa RAM.Semantic cache, real-time recommendations, RAM-sized data.
ĐượcYou gain
Độ trễ mili giây.Millisecond latency.
MấtYou lose
RAM đắt, dung lượng bị giới hạn.Expensive RAM, capped capacity.

Chọn Redis là đổi chi phí trên mỗi vector (RAM đắt) lấy độ trễ mili giây.Choosing Redis trades cost per vector (RAM is expensive) for millisecond latency.

Dấu hiệu nhận biếtTell-tale sign Nếu yêu cầu là vài mili giây và toàn bộ dữ liệu vừa trong RAM, Redis là câu trả lời.If the requirement is a few milliseconds and the whole dataset fits in RAM, Redis is the answer.

Ảnh đúng về độ trễ, nhưng bỏ qua giới hạn quan trọng nhất: mọi vector nằm trong RAM. Tìm vector hiện nằm trong Redis Query Engine (tích hợp sẵn từ Redis 8), cùng kiểu dữ liệu mới Vector Sets.Right about latency, but it skips the biggest limit: every vector sits in RAM. Vector search now ships in the Redis Query Engine (built in since Redis 8), plus the new Vector Sets data type.

05

Elasticsearch

Vector trong DB sẵn cóVectors in a DB you already run

Tự host hoặc Elastic Cloud (OpenSearch là nhánh tương tự)Self-hosted or Elastic Cloud (OpenSearch is a similar fork)

Full-text trưởng thành nhất, có thêm vector trong cùng một truy vấn.The most mature full-text engine, now with vectors in the same query.

Dùng choUse for
Hệ tìm kiếm đã có, cần từ khoá lẫn ngữ nghĩa.Existing search systems that need both keywords and meaning.
ĐượcYou gain
Full-text trưởng thành, hybrid trong một truy vấn.Mature full-text, hybrid in one query.
MấtYou lose
Vận hành cluster nặng, vector chậm hơn DB chuyên dụng.Heavy cluster operations, slower vectors than dedicated DBs.

Chọn Elasticsearch là đổi gánh vận hành cluster nặng lấy full-text trưởng thành và vector trong cùng một truy vấn.Choosing Elasticsearch trades a heavy cluster to operate for mature full-text and vectors in one query.

Dấu hiệu nhận biếtTell-tale sign Nếu người dùng cần highlight, facet, sắp xếp và khớp đúng cụm từ bên cạnh tìm theo nghĩa, Elasticsearch đi trước.If users need highlighting, facets, sorting and exact phrase matches alongside semantic search, Elasticsearch leads.

06

MongoDB Atlas

Vector trong DB sẵn cóVectors in a DB you already run

Atlas (managed); bản tự vận hành đang ở giai đoạn previewAtlas (managed); self-managed editions in preview

Embedding nằm ngay trong document, tìm bằng một stage của aggregation pipeline.Embeddings live inside your documents and are searched with one aggregation stage.

Dùng choUse for
Ứng dụng đã dùng MongoDB Atlas.Applications already on MongoDB Atlas.
ĐượcYou gain
Vector cạnh document, không đồng bộ.Vectors next to documents, no syncing.
MấtYou lose
Gắn với Atlas, ít núm chỉnh ANN.Tied to Atlas, few ANN knobs.

Chọn MongoDB Atlas là đổi khả năng tinh chỉnh và độc lập nhà cung cấp lấy việc vector sống ngay cạnh document.Choosing MongoDB Atlas trades tuning control and vendor independence for vectors that live right next to your documents.

Dấu hiệu nhận biếtTell-tale sign Nếu dữ liệu của bạn đã là document trong Atlas, hãy thử vector search của Atlas trước khi nghĩ tới hệ thống khác.If your data is already documents in Atlas, try Atlas vector search before considering anything else.

Ảnh chỉ ghi MANAGED. Từ cuối 2025, search và vector search bắt đầu có cho MongoDB Community và Enterprise tự vận hành (preview).The image says MANAGED only. Since late 2025, search and vector search have been coming to self-managed MongoDB Community and Enterprise (preview).

Vector DB chuyên dụngDedicated vector DB

Vector sống trong một dịch vụ riêng chỉ để tìm kiếm vector. Một lượt gọi mạng và thêm một hệ thống phải đồng bộ.Vectors live in a separate service built only for vector search. One network hop plus one more system to keep in sync.

07

Pinecone

Vector DB chuyên dụngDedicated vector DB

Chỉ managed (serverless)Managed only (serverless)

Vector database dạng dịch vụ: không có hạ tầng nào để bạn vận hành.A vector database as a service: no infrastructure for you to run.

Dùng choUse for
RAG production khi không có người làm hạ tầng.Production RAG with nobody to run infrastructure.
ĐượcYou gain
Không vận hành, chạy được sau vài phút.Zero operations, running in minutes.
MấtYou lose
Mã nguồn đóng, dữ liệu ở ngoài hạ tầng của bạn.Closed source, data outside your infrastructure.

Chọn Pinecone là đổi quyền kiểm soát hạ tầng và chi phí dễ dự đoán lấy việc không bao giờ phải vận hành một cụm vector.Choosing Pinecone trades infrastructure control and predictable cost for never having to operate a vector cluster.

Dấu hiệu nhận biếtTell-tale sign Nếu câu hỏi 'ai trực khi database sập lúc 3 giờ sáng?' không có người trả lời, Pinecone là ứng viên đầu tiên.If nobody can answer 'who gets paged when the database dies at 3 a.m.?', Pinecone is the first candidate.

08

Weaviate

Vector DB chuyên dụngDedicated vector DB

Tự host hoặc Weaviate CloudSelf-hosted or Weaviate Cloud

Tìm kiếm lai từ khoá + vector là tính năng lõi, không phải phần gắn thêm.Hybrid keyword + vector search is a core feature, not an add-on.

Dùng choUse for
Tìm kiếm cần cả từ khoá lẫn ngữ nghĩa.Search that needs both keywords and meaning.
ĐượcYou gain
Hybrid sẵn có, tự vector hoá qua module.Built-in hybrid, automatic vectorisation via modules.
MấtYou lose
Tốn RAM nếu không nén, nhiều khái niệm phải học.RAM-hungry without compression, lots of concepts to learn.

Chọn Weaviate là đổi sự đơn giản của một kho vector thuần lấy hybrid search và pipeline embedding tích hợp sẵn.Choosing Weaviate trades the simplicity of a pure vector store for built-in hybrid search and an integrated embedding pipeline.

Dấu hiệu nhận biếtTell-tale sign Nếu truy vấn của người dùng trộn lẫn mã, tên riêng và câu mô tả, bạn cần hybrid, và Weaviate làm việc này sẵn.If user queries mix codes, proper nouns and descriptive phrases, you need hybrid, and Weaviate does it out of the box.

Ảnh ghi 'GraphQL API'. GraphQL vẫn còn, nhưng client hiện tại (v4) chủ yếu dùng gRPC và REST. Điểm đáng chọn thật là hybrid search và module vectorizer.The image says 'GraphQL API'. GraphQL still exists, but current (v4) clients mainly use gRPC and REST. The real reason to choose it is hybrid search and vectorizer modules.

09

Milvus

Vector DB chuyên dụngDedicated vector DB

Cluster tự host, Zilliz Cloud (managed), Milvus Lite (nhúng)Self-hosted cluster, Zilliz Cloud (managed), Milvus Lite (embedded)

Kiến trúc phân tán cho hàng trăm triệu tới hàng tỷ vector.A distributed architecture for hundreds of millions to billions of vectors.

Dùng choUse for
Hàng trăm triệu tới hàng tỷ vector, có đội hạ tầng.Hundreds of millions to billions of vectors, with an infra team.
ĐượcYou gain
Scale ngang, nhiều loại index, có GPU.Horizontal scale, many index types, GPU.
MấtYou lose
Nhiều thành phần, vận hành nặng.Many components, heavy operations.

Chọn Milvus là đổi sự đơn giản trong vận hành lấy khả năng scale ngang tới hàng tỷ vector.Choosing Milvus trades operational simplicity for horizontal scale up to billions of vectors.

Dấu hiệu nhận biếtTell-tale sign Nếu bạn đếm vector bằng đơn vị trăm triệu và có đội hạ tầng vận hành Kubernetes, Milvus đáng cân nhắc.If you count vectors in hundreds of millions and have an infrastructure team running Kubernetes, Milvus is worth a look.

Ảnh ghi chỉ SELF-HOST. Milvus có bản managed là Zilliz Cloud và bản nhúng Milvus Lite cài bằng pip.The image says SELF-HOST only. Milvus has a managed service, Zilliz Cloud, and an embedded build, Milvus Lite, installed with pip.

10

Qdrant

Vector DB chuyên dụngDedicated vector DB

Tự host (một binary/Docker) hoặc Qdrant CloudSelf-hosted (single binary/Docker) or Qdrant Cloud

Tìm vector kèm bộ lọc phức tạp mà không hụt kết quả, viết bằng Rust.Vector search with complex filters that never comes back short, written in Rust.

Dùng choUse for
Truy vấn luôn đi kèm bộ lọc nặng.Queries that always carry heavy filters.
ĐượcYou gain
Lọc chính xác trong lúc tìm, nhẹ, nhanh.Accurate in-search filtering, light and fast.
MấtYou lose
Full-text yếu, hệ sinh thái nhỏ hơn.Weak full-text, smaller ecosystem.

Chọn Qdrant là đổi sức mạnh full-text và hệ sinh thái rộng lấy tìm kiếm vector có lọc vừa nhanh vừa đủ kết quả.Choosing Qdrant trades full-text power and a broad ecosystem for filtered vector search that is both fast and complete.

Dấu hiệu nhận biếtTell-tale sign Nếu truy vấn nào cũng có một mệnh đề WHERE với nhiều điều kiện, Qdrant là lựa chọn tự nhiên.If every query carries a WHERE clause with several conditions, Qdrant is the natural choice.

Bảng đánh đổiTrade-off table

Các trục quyết định thật: vector nằm ở đâu, lớn tới đâu thì còn thoải mái, lọc và tìm lai tốt tới mức nào, ai phải vận hành, và giấy phép gì.The axes that actually decide: where vectors live, how big it stays comfortable, how good filtering and hybrid search are, who operates it, and under what licence.

HệSystemHọFamilyChạy ở đâuWhere it runsQuy mô thoải mái*Comfortable scale*Lọc metadataMetadata filteringTìm kiếm laiHybrid searchGánh vận hànhOps burdenGiấy phépLicence
ChromaNhúng / thư việnEmbedded / libraryTrong process, server, CloudIn-process, server, CloudTriệuMillionsCơ bảnBasicHạn chế ở bản OSSLimited in OSSRất thấpVery lowApache 2.0Apache 2.0
FAISSNhúng / thư việnEmbedded / libraryTrong processIn-processTỷ, nếu bạn tự xây phần còn lạiBillions, if you build the restGần như khôngAlmost noneKhôngNoneBạn tự làm tất cảYou build everythingMITMIT
pgvectorVector trong DB sẵn cóVectors in a DB you already runPostgres của bạnYour PostgresTới khoảng chục triệuUp to ~10 millionSQL đầy đủ (cần iterative scan)Full SQL (needs iterative scan)Tự ghép với tsvectorDIY with tsvectorThấp nếu đã có PostgresLow if you run PostgresPostgreSQLPostgreSQL
RedisVector trong DB sẵn cóVectors in a DB you already runRedis, Redis CloudRedis, Redis CloudGiới hạn bởi RAMBounded by RAMTốtGoodCóYesThấp nếu đã có RedisLow if you run RedisRSALv2 / SSPL / AGPLv3RSALv2 / SSPL / AGPLv3
ElasticsearchVector trong DB sẵn cóVectors in a DB you already runCluster, Elastic CloudCluster, Elastic CloudTrăm triệuHundreds of millionsTốtGoodMạnh nhất (BM25 + RRF)Strongest (BM25 + RRF)CaoHighAGPLv3 / SSPL / ELv2AGPLv3 / SSPL / ELv2
MongoDB AtlasVector trong DB sẵn cóVectors in a DB you already runAtlas (bản tự vận hành: preview)Atlas (self-managed: preview)Trăm triệuHundreds of millionsTốt (khai báo trước trong index)Good (declared in index)Có ($rankFusion)Yes ($rankFusion)ThấpLowDịch vụ thương mạiCommercial service
PineconeVector DB chuyên dụngDedicated vector DBCloud của PineconePinecone's cloudRất lớn, không phải loVery large, not your problemTốtGoodCó (sparse-dense)Yes (sparse-dense)Gần như bằng khôngNear zeroMã nguồn đóngClosed source
WeaviateVector DB chuyên dụngDedicated vector DBServer, Weaviate CloudServer, Weaviate CloudTrăm triệuHundreds of millionsTốtGoodMạnh (BM25 sẵn có)Strong (built-in BM25)Trung bìnhMediumBSD-3BSD-3
MilvusVector DB chuyên dụngDedicated vector DBCluster, Zilliz Cloud, LiteCluster, Zilliz Cloud, LiteTỷBillionsTốtGoodCó (sparse + BM25)Yes (sparse + BM25)Cao nếu tự chạy clusterHigh for a self-run clusterApache 2.0Apache 2.0
QdrantVector DB chuyên dụngDedicated vector DBBinary/Docker, Qdrant CloudBinary/Docker, Qdrant CloudTrăm triệuHundreds of millionsMạnh nhất (lọc trong lúc tìm)Strongest (in-search filtering)Có (sparse)Yes (sparse)Thấp tới trung bìnhLow to mediumApache 2.0Apache 2.0

*Quy mô thoải mái là ước lượng định hướng cho một cấu hình hợp lý, không phải giới hạn cứng. Hãy benchmark trên dữ liệu và bộ lọc của chính bạn.*Comfortable scale is a rough guide for a sensible setup, not a hard limit. Benchmark with your own data and filters.

Anti-patterns

Những sai lầm gặp nhiều nhất, và cách sửa từng cái.The most common mistakes, and how to fix each one.

Sai lầmMistakeVì sao saiWhy it's wrongSửa thế nàoHow to fix it
Chọn vector DB chuyên dụng trước khi đo bất cứ thứ gì.Picking a dedicated vector DB before measuring anything.Thêm một hệ thống phải đồng bộ, backup và phân quyền, trong khi DB sẵn có có thể đã đủ.It adds a system to sync, back up and secure, when the database you already run may be enough.Bắt đầu với DB bạn đang chạy hoặc brute force; chỉ chuyển khi đo được recall hay p95 không đạt.Start with your existing database or brute force; move only when measured recall or p95 falls short.
Chỉ benchmark tốc độ, không đo recall.Benchmarking speed without measuring recall.ANN có thể nhanh gấp mười lần nhờ bỏ sót kết quả đúng. Nhanh mà sai thì vô dụng.An ANN index can be ten times faster because it skips correct results. Fast and wrong is useless.Đo recall@k so với tìm chính xác trên một mẫu truy vấn thật, song song với độ trễ.Measure recall@k against exact search on a sample of real queries, alongside latency.
Lọc sau khi tìm (post-filter) với bộ lọc chọn lọc mạnh.Post-filtering with a highly selective filter.Lấy top-100 rồi mới lọc theo tenant có thể chỉ còn 2 kết quả, hoặc không còn kết quả nào.Take the top 100, then filter by tenant, and you may be left with 2 results or none.Dùng DB lọc trong lúc tìm (Qdrant, iterative scan của pgvector) hoặc tạo index riêng theo phân vùng.Use a database that filters during search (Qdrant, pgvector iterative scans) or build per-partition indexes.
Đổi model embedding mà không index lại.Switching embedding models without re-indexing.Vector từ hai model khác nhau không nằm cùng một không gian; khoảng cách giữa chúng vô nghĩa.Vectors from two different models don't share a space; distances between them are meaningless.Lưu phiên bản model cạnh mỗi vector; build collection mới song song rồi chuyển alias.Store the model version with each vector; build a new collection in parallel and switch an alias.
Dùng FAISS như một database.Using FAISS as a database.Không persistence, không CRUD an toàn; process chết là mất dữ liệu chưa lưu.No persistence, no safe CRUD; if the process dies, unsaved data is gone.Dùng một database, hoặc tự bọc FAISS bằng lớp lưu trữ và job rebuild rõ ràng.Use a database, or wrap FAISS in an explicit storage layer with a rebuild job.
Chạy Chroma nhúng cho nhiều worker cùng ghi.Running embedded Chroma with several writing workers.Nhiều process ghi cùng một thư mục dẫn tới lỗi khoá hoặc hỏng dữ liệu.Several processes writing to one folder leads to lock errors or corrupted data.Chạy Chroma ở server mode, hoặc chuyển sang DB có hỗ trợ ghi đồng thời.Run Chroma in server mode, or move to a database built for concurrent writes.
Dùng sai metric khoảng cách.Using the wrong distance metric.Dùng dot product với vector chưa chuẩn hoá làm vector có độ dài lớn luôn thắng, bất kể nội dung.Dot product on unnormalised vectors lets long vectors win regardless of content.Dùng đúng metric mà nhà cung cấp model khuyến nghị; chuẩn hoá L2 nếu muốn cosine qua dot product.Use the metric the model provider recommends; L2-normalise if you want cosine via dot product.
Đổ lỗi cho vector DB khi retrieval kém.Blaming the vector DB for poor retrieval.Chunk quá dài hoặc quá ngắn, hay model embedding không hợp ngôn ngữ, gây hại nhiều hơn chọn sai DB.Chunks that are too long or too short, or an embedding model that doesn't fit your language, hurt more than the wrong database.Sửa chunking và thử model embedding khác trước; thêm reranker trước khi đổi DB.Fix chunking and try another embedding model first; add a reranker before switching databases.

3 câu cần nhớ3 things to remember

  1. Câu hỏi đầu tiên không phải 'dùng vector DB nào' mà là 'vector nên sống ở đâu': trong tiến trình, trong database bạn đã có, hay trong một dịch vụ riêng.The first question is not 'which vector DB' but 'where should the vectors live': in your process, in a database you already run, or in a separate service.
  2. Dưới vài triệu vector, hầu hết các lựa chọn đều đủ nhanh; khác biệt thật nằm ở khả năng lọc, tìm kiếm lai và gánh vận hành.Below a few million vectors almost every option is fast enough; the real differences are filtering, hybrid search and operational load.
  3. Chất lượng retrieval phụ thuộc vào embedding và chunking nhiều hơn vào database, nên hãy đo recall trước khi đổi hệ thống.Retrieval quality depends on embeddings and chunking more than on the database, so measure recall before you switch systems.