When deciding between implementing multitenancy in PostgreSQL using separate schemas or separate databases, each approach has its pros and cons, depending on your use case. Use schemas for multitenancy if you want shared resources, moderate isolation, and easier management for many tenants. Use separate databases if you need strong isolation, better performance guarantees, or have specific tenant requirements that necessitate complete separation. Really, it comes down to the level of isolation you need. Both ways are supported by our multitenancy approach. Great question!
How would you ensure security with this "tenant-id" header, so that only users authorized for that specific tenant can get data using its tenant-id? Also, why not just store that in the JWT?
Man, is an example lecture. If you want to implement it in production code, you can validate the request using JWT or similar approach, and then read the tenant of your principal using the validated token. Take this as an initial point, you'll need to abstract it to your specific use case.
Get access to the full lecture which includes Drizzle ORM & Async Local Storage integration: michaelguay.dev/
Hi Michael bought two of your courses on Udemy :D if somehow you were accepting request, can you also make video about transactions?
well hot damn, you've bent my arm with this video.....will definitely become a member
Incredible content, more about multi tenant please
Why are you saving the tenant mapping as JSON and not as TS file? Thanks for the nice guide! Love the more advanced insights.
Why don't we use different schemas instead of a separate database for each tenant?
Exactly
When deciding between implementing multitenancy in PostgreSQL using separate schemas or separate databases, each approach has its pros and cons, depending on your use case.
Use schemas for multitenancy if you want shared resources, moderate isolation, and easier management for many tenants.
Use separate databases if you need strong isolation, better performance guarantees, or have specific tenant requirements that necessitate complete separation.
Really, it comes down to the level of isolation you need. Both ways are supported by our multitenancy approach.
Great question!
Are you available for a Business Discussion regarding your Udemy Course Growth?
Hi michael, do you know if there’s good job opportunities for nestjs developers ? Or what would you learn instead maybe like Golang, thanks.
Thank you so much!
How would you ensure security with this "tenant-id" header, so that only users authorized for that specific tenant can get data using its tenant-id? Also, why not just store that in the JWT?
Man, is an example lecture. If you want to implement it in production code, you can validate the request using JWT or similar approach, and then read the tenant of your principal using the validated token.
Take this as an initial point, you'll need to abstract it to your specific use case.
Thank you so much!