is it possible to create collection per user? #33510
-
So, for example with half a million users. Is it possible to create collection per user? any advice for this one? or should I add a metadata? or something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Each time you create a new collection, milvus will add more threads to manage the collection. With a larger number of collections, milvus could run into trouble or slow response. So, it is strongly recommended to keep the number of collections under 1000. Partition key is a good solution for handling millions of users: https://milvus.io/docs/multi_tenancy.md#Partition-oriented-multi-tenancy For example, we create a collection with a partition key field: "username", is_partition_key=True
Then declare a collection, set the number of partitions: When we insert data, we assign a user name for each record. When we search, we use filtering expression to search the records of a user: With username=='Mike', milvus can quickly know which partition to be searched according to the hash value of "Mike". Then it only search the records of "Mike" inside the partition. |
Beta Was this translation helpful? Give feedback.
Each time you create a new collection, milvus will add more threads to manage the collection. With a larger number of collections, milvus could run into trouble or slow response. So, it is strongly recommended to keep the number of collections under 1000.
Partition key is a good solution for handling millions of users: https://milvus.io/docs/multi_tenancy.md#Partition-oriented-multi-tenancy
For example, we create a collection with a partition key field: "username", is_partition_key=True