3 ms·
Let me start by saying that apartment is great - but it takes a different approach. The most important difference is that apartment shards by database or schem
by lfittl 10y ago
Let me start by saying that apartment is great - but it takes a different approach.
The most important difference is that apartment shards by database or schema, vs activerecord-multi-tenant puts all your data into the same table, and then relies on a PostgreSQL extension like Citus to do the distribution.
There is trade-offs to both, but part of the reason we prefer the latter approach is that schema changes become a lot easier, and you can do shard-splitting based on a shard count, as opposed to just by tenant, effectively grouping smaller tenants together on a node.
I'll also give a shout-out to acts_as_tenant, which our library is based on, although we've deviated a bit since then.