Crafting Multi-Tenancy through Database and App Design
The previous chapter equipped you with strong authentication knowledge and the ability to create as many users as you want. Those users can now log in and see the Ticket Management UI, where a mocked tenant name and some mocked data can be found. But there is no sense of multi-tenancy yet. This is going to change now.
After clarifying the meaning of multi-tenancy, you will lay the database foundations for it by creating tables, a few tenants, and permissions to define which user should be able to access which tenant. With an excursion to backing up your database, you’ll ensure that none of your wonderful changes will be lost and see how that enables benefits teamwork as a nice side effect.
You’ll also overhaul your Next.js application so that it becomes tenant-aware and you can enable multi-tenancy with ease. We’ll finish up by learning how to combine everything we’ve learned to make sure that...