Database / Milvus Vector database Interview questions
What is a Collection in Milvus?
A Collection is Milvus's top-level container for data, roughly analogous to a table in a relational database. It has a defined schema (field names, data types, and which field(s) hold vector embeddings) and holds all the entities, individual records, inserted into it.
from pymilvus import MilvusClient, DataType client = MilvusClient("http://localhost:19530") schema = client.create_schema() schema.add_field("id", DataType.INT64, is_primary=True) schema.add_field("embedding", DataType.FLOAT_VECTOR, dim=768) schema.add_field("category", DataType.VARCHAR, max_length=64) client.create_collection(collection_name="products", schema=schema)
Every Collection needs at least one primary key field and at least one vector field; scalar fields (strings, numbers, booleans) can be added alongside the vector to support filtered search, and Milvus also supports enabling a dynamic field to store arbitrary additional key-value data per entity without predefining every possible field in the schema up front.
More Related questions...