Multitenancy in Rails

If you are a Rails developer, it is only a matter of time until a client approaches you to build a multitenant SaaS app.

Multitenancy applications are unique in the respect that data between tenants needs to separated by a virtual iron wall. In this post I will discuss the three common solutions for creating multitenant apps in Rails, what I dislike about each one, and I'll propose a new implementation which is simpler, cleaner, and very effective.