Skip to content
Discussion options

You must be logged in to vote

I personally would instead reach for a solution that you did not include in your original post.

I would do one database, and use account_id on database records to identify which records belong to which tenant.

This pushes tenancy up to be an application level concern. This means you have to add extra where clauses to all your queries.

However, it has a lot of benefits.

  • simplicity. You don't have to worry about managing many databases.
  • flexibility to evolve your data model. For instance, one user can belong to multiple accounts and see all their data in one page (and you only have to query one database).

My understanding is that this is the most common pattern for multi-tenancy in SaaS a…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mkevison
Comment options

@davidharting
Comment options

Answer selected by mkevison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants