Multi Tenancy with NestJS async-hooks

Note: the async_hooks feature is still in stability state 1. Thus, no backwards compatibility or guaranteed integrity with npm is guaranteed for future releases. Use with caution! In the post Multi Tenancy with Nestjs I explained an approach using NestJS factory providers. As this changes the scope of all dependent classes to REQUEST, it may lead to a major performance decrease. Each request would generate new instances of each class in injection chains which have the Tenant injected....

December 25, 2020 · 3 min · Fabian Isele