Menu

Multi-tenant architecture: Database per tenant or shared database with tenant_id?

#php#redditr#tenant#database#laravel
Reading 0:00
15s threshold

I’m currently working on a multi-tenant construction management system using Laravel, and I’m trying to figure out the best approach for handling tenancy.

I have two questions:

Database architecture

For a system like this, would you recommend having a separate database for each tenant, or using a single shared database with a tenant_id column to isolate tenant data?

I’m currently leaning towards the second approach because it seems simpler to maintain, but I’d like to hear about the trade-offs, especially as the application grows.

Authentication and tenant switching

If I go with a shared database approach, how would you recommend handling authentication?

For example, an employee might work with multiple construction companies (tenants).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.