123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computer-Programming >> View Article

How We Retrieve Tenant Data In A Multi-tenant App With Detectify

By Author: Sviatoslav Andrushko
Total Articles: 10

We often build multi-tenant applications for Software as a Service (SaaS) providers. As we know, support for multi-tenancy is imperative for a SaaS application because a single instance of the app must manage data for multiple clients. The difference between a multi-tenant and a single-tenant app chiefly concerns the database tier, or layer. Multi-tenant and single-tenant refers to how client data is stored and accessed in a database.
But this article won’t talk about how to segregate client data in a database schema (or schemas) with Ruby gems, such as Apartment and Multitenancy. Instead, we’ll explain how to work around a different challenge – retrieving specific data depending on the tenant’s domain or subdomain name. We’ll present our own solution for this task, which you can use to build your own multi-tenant SaaS application.
Identifying the Tenant in a Multi-Tenant App
We often see URLs similar to these: tenant-one.webapp.com and tenant-two.webapp.com. For example, Slack allocates the rubygarage.slack.com subdomain for our RubyGarage team, and we must enter our subdomain – rubygarage – to sign in. This approach to building a multi-tenant web application can be called partial white-labeling (i.e. we don’t get our own full domain for Slack).

We commonly retrieve a tenant’s data (an entity) from Active Record using a subdomain name in our SaaS projects.
For example, we’re working on a project called Shopperations, a SaaS application designed for shopper marketers. Shopperations allows multiple tenants (companies) to separately work on their respective marketing projects. When a Shopperations user (a company representative) wants to sign in to the Shopperations application, they have to enter their subdomain.

Total Views: 67Word Count: 4842See All articles From Author

Computer Programming Articles

1. How Ai (artificial Intelligence) Can Help In Web Design And Development?
Author: Mikejordan

2. Oracle Dba Training Institute In Ameerpet
Author: reddiamond

3. 5 Ways To Solve The Biggest Iphone App Development Problems
Author: Ashesh Shah

4. Website Development Reasons Your Website Should Be Responsive
Author: Rose Carter

5. All You Need To Know About Java Programming
Author: Sayali Desai

6. An Beginner's Guide To Data Structure In Programming
Author: Sayali Desai

7. Pc Touch Screen Has Got The Right Kind Of Back Up From Scada Application!
Author: James Finch

8. Hmi Scada Can Help The Operators To Determine The Real Cause Behind Issues Quickly!
Author: Archer Finch

9. Scada Software Can Be Used To Handle The Automation Of Big Scale Processes!
Author: James Finch

10. Web Scada Can Bring Handy Outcome For Plant Managers And Operators!
Author: James Finch

11. Top Programming Patterns To Search For In 2018
Author: Infocampus Logics Pvt Ltd

12. How To Automate Ftp Transfers And Streamline Your Workflow
Author: Vladimir Davidenko

13. Python Training Classes In Noida/delhi Ncr/ghaziabad
Author: Arvind Gupta

14. Integrating With Dynamics Ax
Author: Korcomptenz

15. Software Company In Bhubaneswar
Author: Alok Biswal

Login To Account
Login Email:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: