Ask HN: How did you get multitenancy right?
Eg: There's a client who has a country wide platform, but he also has 2 platforms specific for two cities/communities(cities A and B). Projects hosted on the country-wide platform that are on city A, should show up on the A-city platform. Also, all projects on the A-city platform should show up on the country wide platform.
So, basically what we want is to have multi-tenancy but allowing data to flow freely between multiple platforms/websites. Our current solution involves sharing a database between all the platforms and every table has a 'channel' column, where we tag which site the row is from. Using this we can design content flow rules between the channels. The downside is that all the data is cramped together now, with unrelated clients sharing the same database and this will be hard to scale, insecure and hard to maintain.
With this being said, we are looking for a solution that allows us to integrate multiple tenants data, we've been looking currently at stuff like PostgreSQL dblink and at the idea of duplicating data but every solution we see seems to have huge flaws.
With all that being said, how did you solve your multitenancy problems? What should we consider?