🏢 Clean Core Production Architecture

SAP BTP Multi-Tenant SaaS & MTX Architecture Guide

Complete guide to designing, deploying, and governing secure multi-tenant SaaS solutions with SAP BTP SaaS Registry, CAP MTXS, isolated HDI containers, and subscriber extensibility.

1. The Multi-Tenancy Imperative on SAP BTP

When software vendors (ISVs) or global enterprises deploy applications on SAP BTP to serve multiple independent customers or decentralized operating entities, multi-tenancy becomes the primary architectural foundation. Under the Clean Core paradigm, multi-tenancy ensures that base applications remain completely upgrade-stable while granting each subscriber isolated data storage and custom extensibility.

Isolation Model Data Separation Mechanism Security & Regulatory Fit Operational Complexity
Isolated HDI Container (Recommended) Dedicated SAP HANA Database Container per subscriber via SAP Service Manager Highest (Banking, Healthcare, GDPR, FIPS 140-3 compliant) Automated via CAP MTXS lifecycle provisioning
Discriminator Column Single shared database table with TENANT_ID filter injected in CDS layers Medium (Potential data-leak vulnerability if SQL bypasses CDS security) Low database footprint; high manual audit requirement
ABAP Cloud Client Client-dependent database tables (MANDT / @ClientHandling.type: #CLIENT_DEPENDENT) High (Standard SAP S/4HANA enterprise client architecture) Managed natively by the SAP kernel & RAP framework

2. BTP SaaS Architecture Building Blocks

A production SAP BTP SaaS application requires three coordinated cloud services:

3. The Subscription Lifecycle Flow

When a tenant administrator clicks Subscribe in their SAP BTP Subaccount, the following orchestration occurs:

  1. Subscription Trigger: SAP BTP Subaccount triggers a PUT callback to the application's SaaS Registry endpoint: /mtx/v1/provisioning/tenants/{tenantId}.
  2. Authentication Validation: The MTXS sidecar validates the incoming OAuth2 token from the SaaS Registry using the Callback scope defined in xs-security.json.
  3. Service Manager Provisioning: MTXS calls the SAP Service Manager API to create a new HANA HDI container bound to the specific subscriber GUID.
  4. Database Schema Migration: MTXS deploys the latest CDS data models into the new tenant container.
  5. Launchpad URL Return: The application returns the tenant-specific routing URL (e.g. https://subscriber-subdomain-app.cfapps.eu10.hana.ondemand.com) to the BTP Cockpit.

4. Implementing Subscriber Extensibility (MTX)

The CAP MTXS framework allows subscribers to add custom fields and custom entities to the standard SaaS solution without touching provider code:

// subscriber-extension/db/ext.cds
using { sap.invoice as base } from '@sap/base-invoice-service';

// Extend base business entity with custom enterprise fields
extend entity base.Invoices with {
  Z_CustomTaxComplianceCode : String(40);
  Z_SustainabilityRating    : Decimal(5, 2);
  Z_AuditTrailTimestamp     : Timestamp;
};
🛡 Clean Core Extensibility Governance Enforce prefix controls in package.json (e.g., "element-prefix": ["Z_", "ZZ_"]) to avoid namespace collisions between base SaaS product updates and subscriber extensions.

5. Interactive Tool Companion

Use our free web utility to generate production mta.yaml manifests, SaaS subscription lifecycle callbacks, and CAP MTXS package configurations:

→ Open SAP BTP Multi-Tenant SaaS Extension Architect (Tool #69)

Scale Your Enterprise Multi-Tenant Solutions

Explore end-to-end architectures, automated continuous tenant deployment pipelines, and cross-tenant security hardening in our comprehensive books.