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!

Technical requirements

The code for this ...

Get jOOQ Masterclass now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.