Identifying Deployment Options in CAP

After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Identify the deployment options of a CAP application

Exploring Deployment Options in CAP


You have developed a stable version of your CAP project and now you want to deploy it to the SAP BTP. You have different options to deploy your project. In this lesson, you will learn about the different deployment options.

Deployment Options

When it comes to deploying a CAP application, there are different options. The following figure, Deployment Options of a CAP Application, shows the different options.

On the SAP Business Technology Platform (SAP BTP), the two runtimes SAP BTP, Kyma Runtime and SAP BTP, Cloud Foundry Runtime can be targeted for deployment. Additionally to deploying them in runtime on a specific subaccount, it's also possible to deploy the CAP application as a Service (SaaS) to SAP BTP, Cloud Foundry Runtime or SAP BTP, Kyma environment. The application can then be subscribed by multiple SaaS consumers (other subaccounts) from the Service Marketplace.

SAP BTP, Cloud Foundry Runtime

The deployment to Cloud Foundry is very straightforward. CAP leverages the Multi-Target Application (MTA) approach to deploy the application to the Cloud Foundry environment. A MTA is logically a single application consisting of multiple related and interdependent parts (modules) that are developed using different technologies or programming paradigms and designed to run on different target runtime environments with a single, consistent lifecycle.

More on MTA later in this course. See the CAP Documentation for a complete Cloud Foundry Deployment Guide.

SAP BTP, Kyma Runtime

Deployment to the SAP BTP, Kyma Runtime is possible. CAP leverages pack and helm Charts to ease the deployment process. You don't have to deal with creating your own Dockerfiles and container images. The tool-set will handle this for you. If you are new to Kyma and Kubernetes, make sure to check out the free Kyma Learning Journey.

Read more about the Kyma deployment process in the CAP documentation.

Multitenancy (SaaS)

Deploying a CAP (SAP Cloud Application Programming Model) application as a Software as a Service (SaaS) application involves making your application accessible to multiple tenants within a shared infrastructure. These applications are designed to provide data isolation, customization, security, and scalability for each tenant while efficiently utilizing shared resources. This approach is common in software-as-a-service (SaaS) and cloud-based enterprise applications, where multiple customers or organizations use the same application instance while maintaining their data and configurations separately.

CAP has built-in support for multitenancy with the @sap/cds-mtxs library, providing a set of CAP services which implement multitenancy, features toggles and extensibility.

The steps for enabling multitenancy for your SaaS application would be:

  1. npm add @sap/cds-mtxs
  2. Navigate to package.json and add one or more of the following flags, depending on the requirements:
    Code snippet
    "cds": {
       "requires": {
         "multitenancy": true,
         "extensibility": true,
         "toggles": true

SaaS applications need to register with the SAP BTP SaaS Provisioning service to allow different tenants to subscribe or unsubscribe to the application. On top of this, the Service Manager can be used for creating a new SAP HANA Deployment Infrastructure (HDI) container for each tenant and for retrieving tenant-specific database connections.

As this is a multitenant application, using a Standalone App Router is best practice for creating multitenant applications on SAP BTP. The App Router is a Node.js library used as a single entry point for an application running on SAP BTP. More details on this on the next lesson.

Read more about Building SAAS Applications with CAP and MTX Services in the CAP documentation.

Custom Deployment

Creating a custom build of a SAP Cloud Application Programming (CAP) application for deployment typically involves the process of compiling and packaging your CAP application's source code and assets into a production-ready bundle that can be deployed to your chosen deployment environment.

cds build executes build tasks on your project folders to prepare them for deployment. You can customize the behavior of the cds build process by providing options, flags, or configuration files as part of your project's settings or through command-line arguments.

An example of a command with options: cds build --production.

Read more about Custom Builds for deployment in the CAP documentation.


When deploying a SAP Cloud Application Programming (CAP) application, you have several deployment options, depending on your specific requirements, infrastructure, and preferences. If SAP BTP is the cloud platform of choice, the environments that can be used for both multitenant (SAAS) and single tenant application on the Cloud Foundry or Kyma environments. Choose Cloud Foundry when you need a simpler deployment model with high-level abstractions. Choose Kyma when you require extensive control over containerized applications and microservices, especially in a Kubernetes ecosystem.

Log in to track your progress & complete quizzes