louiezzang / faiss-server

Faiss server for efficient similarity search and clustering of dense vectors
23 stars 5 forks source link

K8S pod sync #2

Open nazzour opened 2 years ago

nazzour commented 2 years ago

Hello, first of all thank you for your work, it is really very simple to use and very helpful. I just have an issue with deploying to k8s. If we deploy with more than one replica, each pod will have its own index and thus if we make a search we will have different results depending on the pod. I know that there are some projects that are trying to solve this issue like milvus but do you see any simple solution for this issue ? Thanks in advance

louiezzang commented 2 years ago

Hey @nazzour , Sorry for late reply. Updated my reply again.

CASE 1: If the two faiss-servers have the same embedding dimension but different vector content, you can deploy to K8S with StatefulSet mode. And you can access the specific POD with different host name in the explicit way. I think this could be your use case. Please see the StatefulSet K8S yaml file example https://github.com/louiezzang/faiss-server/blob/master/faiss-server-k8s-example-stateful.yaml

CASE 2: If you want to deploy two different faiss-servers(which have different embedding dimension), you have to deploy each to K8S with the different K8S yaml files for each purpose. In the specific faiss-server(K8S yaml file), you can create replicas(eg. 2 PODs) which will have the exact same embeddings.

Hope this would help you. Please let me know if you have any question or issue. Thanks!