#community-help

Multi-tenant WooCommerce Stores Conversion to Headless and Typesense

TLDR Campbell asks for advice on handling multiple WooCommerce stores in Typesense. Kishore Nallan suggests using one collection per customer for flexibility in features like synonyms and curation.

Powered by Struct AI

2

7
7mo
Solved
Join the chat
Mar 17, 2023 (7 months ago)
Campbell
Photo of md5-a51fb0482e5dbe39a8022f2a541f1e27
Campbell
08:58 AM
I have a scenario I'd appreciate feedback on regarding multi-tenant.

We're converting multiple WooCommerce stores to headless, and we'll use typesense for both search/filtering , but also as a better alternative to graphql for retrieving store data such as product, category and general site info.

We expect we'll manage 100+ stores, and each will need data in Typsense. Should we use a single cluster and have all sites write to the same collections, and use Scoped Search Keys for each frontend, or is there a better way to do this? Perhaps each site should have it's own separate collections for category, product, page etc?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:13 AM
๐Ÿ‘‹ If you plan to have millions of records per customer, it's better to split the collections out. It need not even be 1 per customer. You could do N customers per collection as well.

The other thing to keep in mind is that synonyms and curation are stored at a collection level so if you plan to use those features, then you have to use 1 collection per customer.
Campbell
Photo of md5-a51fb0482e5dbe39a8022f2a541f1e27
Campbell
11:43 AM
Thanks Kishore - your point about synonyms and curation are very important. Every client will be different in that regard.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:44 AM
Then I suggest sticking with 1 collection per customer: I have seen people using 100s of thousands of collections so no worries there ๐Ÿ˜„
Campbell
Photo of md5-a51fb0482e5dbe39a8022f2a541f1e27
Campbell
11:46 AM
Great. There will be a lot of duplication of collection names, so I'm thinking we use the id of the API key associated with the collection to make it easy for us to identify which collection belongs to who. eg. product-125, product-126 and tie/restrict the api key to the relevant collections.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:47 AM
Yes that sounds good
11:48
Kishore Nallan
11:48 AM
In future we do plan to decouple curation/synonyms from collections -- make them independent entities and make them linkable to any collection.

2