Chapter 17: Multitenancy in jOOQ
Sometimes, our applications need to operate in a multitenant environment, that is, in an environment that operates on multiple tenants (different databases, different tables, or generally speaking, different instances that are logically isolated, but physically integrated). In this chapter, we will cover some common use cases of integrating jOOQ in a multitenant environment based on the following agenda:
- Connecting to a separate database per role/login via the
RenderMapping
API - Connecting to a separate database per role/login via a connection switch
- Generating code for two schemas of the same vendor
- Generating code for two schemas of different vendors
Let's get started!