3 ms·
I use `site_id` in every model and keep everything in a single database. I think this is how Shopify started as well. You can see that because their product, va
by Mystery-Machine 1y ago
I use `site_id` in every model and keep everything in a single database. I think this is how Shopify started as well. You can see that because their product, variant, collection IDs are incremental across all shops. They might be using different solution today, but it feels like this is how they started.
What I like about having everything in one db, until it grows too big, is that I can do cross-users analytics/reporting. I also had it happen, like it was mentioned in the article, that I needed to share some data between users. Having everything in a single database made this much simpler problem than needing to move data between databases.
- julik 1y agoThe "hard problem" with DB tenanting is drawing the line where your "common" apex DB model begins, and where the tenanted data ends.