Using namespaces

Hey everyoneđź‘‹

In my project users can analyze different aspects of their or competitors product. They upload the data or parse it from the web. I store this data in vector database to do some search queries.

I found that I can use a single index and namespaces to separate data related to different users and products, but is it a good approach? Should I create an index for each user and separate product?

Indexes take too long to initialize, and on the free plan, I’m only allowed to have one index, and I’m not sure if it is reasonable to create a separate index for separate user.

Hi @sasha

I think creating a whole index for that would be a total overkill. Using namespaces you need to ask yourself if a user can search across multiple namespaces? If not, then namespaces are the thing for you. That way you “lock” the search to only that namespace, making it a bit more secure if you want to separate what users can search. The other way would be to use Metadata (which I am guessing you will be using for any additional info about products) to split your data and make searching easier.

What I would do: use namespace for user and then add metadata for each vector containing, the product name/id, competitor name/id, any additional info like price, product type etc.

This way I would be able to show the user only his competitors (one or more that they could filter). Compare similar products over multiple competitors etc.

Hope this helps

1 Like

@Jasper thank you, this helps a lot!