Rails multitenancy story in 11 snippets of code

Let me tell you the story of how we implemented Postgres-schema based multitenancy in one of the projects we dealt with. It was an existing single tenant system — though definitions vary. We were meant to multitenantize this system. That was the main precondition that made us pick schema-based approach, but overall, the decision is not obvious. We also went for the Apartment gem, as it was the most mature and popular — but it’s not currently maintained, so we ended up on one of the forks.You can tell a story with a wall of text, but it’s not optimal for everyone. For example, children would rather see some pictures. When it comes to programmers, I guess a lot of you will prefer a snippet of code rather than a wall of text. So let me build the story around those.Please bear with the greek letters — I just wanted to use something more fun than plain digits :).
Rails multitenancy story in 11 snippets of code #ruby #rubydeveloper #rubyonrails #code https://rubyonrails.ba/single/rails-multitenancy-story-in-11-snippets-of-code

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles