Ask A Question

Notifications

You’re not receiving notifications from this thread.

Multi tenancy for one type of user

John Vehr asked in Rails

Chris

Would you ever see a scenerio where you would use a multi tenancy approach for one type of user? For example lets say you have an etsy like example, the vendor would have their own section vendorname.app.com sign in they can have their employees log in though that etc they can upload and manage their own inventory and make just their inventory public to normal users, also allowing for transactions etc
thanks so much

Reply

Honestly, the thing that scales best and is easiest to do for just about all "multitenancy" is to just build it at an application level. Use pundit to verify that someone trying to access the vendor section has permissions.

Multitenency is really more for when you absolutely can't have two customer's data in the same database. Think situations like you are dealing HIPAA or something like that where you are collecting very private data.

In most cases, you just want to scope queries and add permissions to separate out parts of your app to specific users. For example, the vendor section you're talking about. If a user is marked as a vendor, then when they visit the vendor area, they only see their products. And if you want to scope it by domain, lookup the domain and verify if the user has permission, if not redirect them to theirs.

Reply

Thanks Chris makes sense!

Reply

There is a gem for multitenency Apartment Gem

Reply

I have just launched my multitenancy app using Milia Gem which is fantastic and uses primary keys rather than subdomains

Reply

Very Interesting.. I might look into this gem for my future SaaS Platform. Thank you very much for suggesting this gem.

Reply

No worries at all, let me know if you have any questions with it :)

Reply

Thanks will do

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.