Multitenancy

Serving many tenants from one deployment — onboarding, tenant-isolated data, per-tenant schema deployment and the operational tooling around it. It is decided once, before anything is built, and narrows the artifacts in almost every capability downstream: most sharply in caching and anything else holding state in process.

Overview

SAP SHIPSby design
Node.js →

@sap/cds-mtxs Multitenancy, tenant provisioning and model extensibility for CAP.

@sap/cds Isolates tenants at runtime: every service call carries the tenant in its context and the framework connects it to that tenant's database. Provisioning, subscription and per-tenant deployment are @sap/cds-mtxs.

Java →

com.sap.cds:cds-feature-mt The CAP Java feature that makes a Maven application multitenant aware: tenant lifecycle events, per-tenant database containers, and the wiring to the Node.js MTX sidecar.

com.sap.cds:cds-services-bom Carries the tenant in the Request Context across every service call and thread, and opens tenant-specific database connections from it. Provisioning and subscription are cds-feature-mt.

Not covered: It stops at the runtime. Day-two operations — inspecting, upgrading and repairing tenants across a landscape — is where cap-js-community fills in, and that is community-org rather than core.

SourceMTX services — tenant provisioningchecked
THE COMMUNITY ADDS

Artifacts7

7 of 7 artifacts
ArtifactSignals
CDS plugins1
@sap/cds-oysterWebAssembly sandbox for tenant-specific extension code in CAP
Signals
none
CLI tools1
@cap-js-community/mtx-toolCLI for operating tenants of multitenant CAP applications
Signals
none
Packages4
@sap/cdsCAP Node.js runtime
Signals
none
@sap/cds-mtxsMultitenancy, tenant provisioning and extensibility for CAP
Signals
none
com.sap.cds:cds-feature-mtMultitenancy for CAP Java: tenant lifecycle and per-tenant containers
Signals
none
com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
Signals
none
Services1
SAP Software-as-a-Service Provisioning serviceRegisters a multitenant application for subaccount subscriptions
Signals
none

Content19

Group by19 of 19 pieces
Piece, what it offers
From Concept to action: Hands-On with the CAP Operator and the Partner Reference Application
SAP Community, ChristianWeiss, BlogThe reasoningA recipeRunnable code
Building a SaaS Multitenant Application Using SAP CAP Framework — Without a Database
SAP Community, DebashishDas, BlogThe reasoningA recipeRunnable code
Part 2: Runtime Architecture & Cost efficiency gains
SAP Community, ChristianWeiss, part 2 of 3, BlogThe reasoning
Show 16 more
Kyma Evolution: Transforming SAP Kyma into a tailor-made SaaS Platform for sbs extensions
SAP Community, ChristianWeiss, part 1 of 3, BlogThe reasoning
CAP multitenancy with Work Zone
SAP Community, Wouter Lemaire, Blog
Multitenant SaaS Application using CAP
SAP Architecture Center, SAP Architecture Center, Reference architectureThe reasoningA reference
Developing CAP java/node.js mixed mono Multitenant SaaS Applications with Shared Database
SAP Community, xuelong, BlogA recipeRunnable code
New majors
Event-Driven Multi-Tenant Architecture on SAP BTP with CAP and SAP Event Mesh
SAP Community, ale_biagi, BlogThe reasoning
Multitenant SaaS applications on SAP BTP using CAP - The Reloaded Version!
SAP Community, martinfrick, BlogThe reasoningRunnable code
SaaS Self-Onboarding and One-Domain Concept in SAP BTP, Kyma Runtime using CAP
SAP Community, martinfrick, BlogThe reasoningRunnable code
Core changed
Multitenant SaaS applications on SAP BTP using CAP? SAP BTP, Kyma Runtime!
SAP Community, martinfrick, BlogThe reasoning
Multitenant SaaS apps on SAP BTP using CAP? Tried-and-True! – The Expert Features
SAP Community, martinfrick, BlogThe reasoning
Multitenant SaaS apps on SAP BTP using CAP? Tried-and-True! – The Advanced Version
SAP Community, Alper Dedeoglu, BlogThe reasoning
Multitenant SaaS apps on SAP BTP using CAP? Tried-and-True! – The Basic Version
SAP Community, Alper Dedeoglu, BlogThe reasoning
Multitenant SaaS applications on SAP BTP using CAP? Tried-and-True!
SAP Community, martinfrick, BlogThe reasoning
Testing your CAP HANA Artifacts with jest – including multitenancy, hdbprocedure and hdbview
SAP Community, Tristan, BlogThe reasoningA recipeRunnable code
Core changed
Multitenant Business Applications with CAP | Hands-on Video Tutorials
SAP Community, dvankempen, BlogThe reasoning
Multitenant application using Cloud Application Programming Model (CAP)
SAP Community, former_member733211, BlogThe reasoningA recipeRunnable code
Core changed
Getting your head into Cloud Application Programming model multitenancy
SAP Community, andrew_lunde, BlogThe reasoningRunnable code
Core changed
Developing CAP java/node.js mixed mono Multitenant SaaS Applications with Shared Database
SAP Community, xuelong, BlogA recipeRunnable code
New majors

Seen working3

ArtifactSignals
Samples3
mtxs-reviewsMultitenant CAP application using cds-mtxs
No license
SAP-samples/btp-event-driven-multi-tenant-architectureCAP sample of SAP Event Mesh events feeding a multi-tenant SaaS app
none
SAP-samples/partner-reference-applicationPoetry Slam Manager, a multi-tenant SaaS reference app on SAP BTP
none

Details

What changed — and what it makes stale2
@sap/cds 7.0.0, CAP, Node.js

cds 7 dropped support for the old MTX package outright. @sap/cds-mtx, deprecated since cds 6, stopped running at all; @sap/cds-mtxs became the only supported multitenancy library for anything on cds 7 or later.

Makes stale:

Any tutorial or sample that provisions tenants through @sap/cds-mtx. That ran on cds 6; on cds 7 and later the app won't start until it migrates to @sap/cds-mtxs.

SourceCAP release notes, June 2023checked
@sap/cds-mtxs 1.0.0, CAP, Node.js

The core gained a rewritten multitenancy library, @sap/cds-mtxs, alongside the existing @sap/cds-mtx. Where the old library stored tenant extensions as source files and ran a build on the server on every activation, the new one stores only compiled csn files, runs the build locally before deploy, and drops the separate META-tenant container — tenant metadata now lives beside application data.

SourceMigration from Old MTX — capirechecked
Coverage
statecore and community, CAP
assessed
relationshipnarrow by design
also inBTP/BAIP
For your agent