020 is definitely the craziest year I have seen in my entire life. What is happening around the world, no one could see that coming. It’s a mad time.
Here are some crazy things that happened:
Meantime, in the Ruby On Rails we are stuck in the old ways. An earlier solution for multitenancy in Rails is still widely used even though it is not optimal in contemporary times.
I am talking about you, https://github.com/influitive/apartment. You were quite a good fellow over the years and truly useful, but it’s time to move on. Let’s start this new decade with something that doesn’t cause so many problems.
Multitenancy usually means handling many independent tenants from one app. Most popular in SAAS models. There are several types of implementation. Let’s look at them closer.
You have a tenant_id column in every DB table and filter by tenant_id in each query.
Advantages:
Disadvantages:
Every tenant has a separate namespace. In practice, we are creating more tables like:
Namespacing is easily achievable with PostgreSQL schemas.
Advantages:
Disadvantages:
#technology #software-development #ruby-on-rails #architecture #ruby