Seeking Advice on Multi-tenancy Implementation for E-commerce Platform

I’m reaching out to seek some expert advice on implementing a multi-tenancy solution using Weaviate for an e-commerce platform we’re developing.

We’re considering two approaches for our data model, which includes Merchant and Product collections:

  1. Implementing multi-tenancy for both Merchant and Product collections

  2. Implementing multi-tenancy only for the Merchant collection, with a shared Product collection

To illustrate these options, I’ve created a simple diagram:

My current inclination is towards option 2, where only the Merchant collection is multi-tenant, and the Product collection is shared. This approach seems to offer better scalability and easier implementation of marketplace features, while still allowing for merchant-specific product associations through a merchantId field. But my team is still a little bit concerned about products data isolation while keeping a effective, efficient search querying and management of products.

However, I wanted to get your thoughts on this approach:

  1. What option would you recommend for my use case(marketplace/e-commerce platform)?

  2. In your experience, what are the pros and cons of each approach in the context of an e-commerce platform?

  3. Are there any specific Weaviate features or best practices you would recommend for implementing this kind of multi-tenancy model?

  4. How would you advise handling access control and data isolation in a shared Product collection scenario?

Any insights or recommendations you could provide would be greatly appreciated.

Thank you for your time and expertise.

hi @barakaj !!

Welcome to our community :hugs:

Considering that the product collection will be common to all tenants, it does make sense to have a shared collection.

However, right now there is a known bug that will probably hold us back back here for now: WeaviateQueryError when searching for objects stored as a refrence property in a multitenant collection or schema · Issue #5269 · weaviate/weaviate · GitHub
:+1: please leave your thumbs up on this issue to help prioritize it.
:star: and please leave your star in our github repo :wink:

Also, depending on the scale and what you are looking for, a shared product collection may be an overkill.

Option 1 will give you data isolation. Each tenant will have it’s product and merchant collection shards separated from the next tenant.

It also will probably be easier to operate. For example, whenever you need to delete a product in option 2, you’ll need to check for all merchants, in all tenants. The same goes for offboarding a tenant.

While in option 1 you just delete the tenant and you are done.

I am assuming here that you do not want to search for a product and find out the merchants that has their relations, but you want to search for a product on a specific merchant. so each merchant will be your tenant.

So unless you really need to have a shared product collection, option 1 seems more efficient and easier.

One suggestion is to have a clear understanding of the queries/searches that you want to perform, and work backwards, experimenting with the different ways you can model you data in the vector space.

Let me know if this helps.

Thanks!