keyboard_arrow_up
keyboard_arrow_down
keyboard_arrow_left
keyboard_arrow_right
14 Oct 2022
  • Website Development

Mastering Multi-Tenant SaaS (Essential Tools and Techniques)

Start Reading
By Tyrone Showers
Co-Founder Taliferro

Introduction

SaaS applications are an excellent way for companies to provide access to their software and data for employees. These applications are often multi-tenant and allow many different companies to use the same infrastructure. The technical aspects of this can be tricky, but here are some tools you can use to make your life easier:

Role-Based Access Control (RBAC): The accounts have different roles, and access control is based on these roles. The Role Based Access Control (RBAC) is a way of controlling access to resources. RBAC can be used to control access to certain parts of the application or entire applications. It can be implemented in many ways, but some common patterns exist.

In this blog post, we will not go into details about what RBAC is and how it works but focus on how you, as a developer, should think about implementing it in your web application.

Single Sign On (SSO): Account admins can define groups of employees who should have access to certain parts of their application. The users can use their company's primary email address or an SSO provider to sign into the app. The Single Sign On (SSO) feature allows admins to define groups of employees who should have access to certain parts of their application. The users can use their company's primary email address or an SSO provider to sign in.

SSO providers include Google, Facebook, Twitter, and Microsoft

User invitations: Invitations are sent to users via email, usually with a one-time link to verify the email address and create a password.

Onboarding: Onboarding is the process of getting a new user up and running. This includes setting up their account on your platform, adding them to groups they belong to, connecting third-party services (like Google Drive or Slack), etc.

All separate accounts are in a database table with columns for the primary key, account name, and subdomain name.

When you have a multi-tenant system, you'll have one database table for each account. Each row will be an account, and the columns are:

  • The primary key (a unique ID).
  • Account name.
  • Subdomain name (if one was specified).
  • If required, you would add other columns, such as username, email address, etc.

Using subdomains to route requests to individual accounts requires a custom DNS server or wildcard certificates and configuring your web server accordingly. Wildcard certificates aren't free, and configuring your web server can also be tricky.

Wildcard certificates are not free

If you're using them, they'll cost money to buy and renew. Configuring your web server can be tricky, too. You'll likely need to reconfigure some settings for it to work correctly with subdomains for each tenant account.

Conclusion

In this post, we looked at the technical aspects of multi-tenant SaaS. The most common approach is to use subdomains to route requests to individual accounts, but you can also use custom DNS servers or wildcard certificates for your domain name.

Tyrone Showers