Developing multi-tenant applications on the SAP Cloud Platform- Introduction
Consider the following scenario:
‘ITeLO Consulting’ is a trusted SAP partner company that specializes in providing solutions for the Oil and Gas industry. They have adopted the SAP Cloud Platform as the innovation platform to build and run their applications on the cloud. They choose to deliver their solutions via the Software as a service (SaaS) model in which the software is deployed as a hosted service and is available to customers over the internet.
ITeLO Consulting has developed a pollution monitoring dashboard that helps Oil & Gas companies view a comparison of the air pollution levels onsite (at the plant) vs. the air pollution levels at the city (where the plant is located). They have found interest for this solution from certain Oil & Gas companies that want to adopt measures for proactive pollution prevention.
‘ABC PetroCorp’ and ‘XYZ EnergyCorp’ are two such Oil & Gas companies based out of Canada and US respectively, that are buying this solution from ITeLO.
‘Robert’ works for ITeLO Consulting and is the architect for this project. ITeLO has bought an SAP Cloud Platform package enabled with the services required to build this application. They have received a SAP CP account with the services provisioned for the account. Robert is assigned the role of an Administrator in the SAP CP account. Now he is eager to explore how such an application can be built and delivered to his customers as a SaaS application.
An effective solution architecture in Robert’s scenario is to develop a true mutli-tenant SaaS application and deliver it to his customers. Firstly, let’s reach a common understanding of the concept of multi-tenancy itself.
Multi-tenancy is an architecture in which a single instance of a software application serves multiple customers. Each customer is called a tenant.
As a development platform for cloud application development, the SAP Cloud Platform has been designed with multi-tenancy built into its services. Using this capability, Robert can develop and run tenant-aware applications i.e. applications running on shared (virtualized) resources that can be used by multiple consumers (tenants).
There are several benefits that multi-tenant cloud applications bring:
- Reduced TCO: Due to sharing of underlying IT resources and operational costs across customers, the TCO for such an application is low. The cost savings increase as the number of customers served by the multitenant application increases.
- Operational efficiency: Application upgrades, bug fixes can be applied to all tenants by updating the single instance of the provider application.
- Scalability: Helps build and deliver services quickly to customers. On boarding a new customer is a matter of creating a new subscription for that customer.
- Configurability: Allows individual customers to configure their own user store, backend services etc. as required by the application.
Accounts and subscriptions in SAP CP
Provider Account:
As shown in the diagram, there is an SAP CP “Provider” account that hosts the applications. The virtualized resources (Java compute unit), database etc… are allotted to this account. The SAP CP applications will actually run within this account, data generated from the applications is stored on the database within this account.
Consumer Account:
There is an SAP CP “Consumer” account that “subscribes” to the applications running within the provider account. Note that the applications are not copied or run inside the consumer account. Typically a consumer represents a customer. The end users at the customer organization access the subscribed application through a dedicated application URL. When an application is accessed via a consumer specific URL, the application environment is able to identify the current consumer.
Within the consumer account, there is the ability to add configurations that are applied only to that consumer. For e.g. Identity Provider – It is possible to configure the customer’s own Identity Provider as the user store for the SAP CP applications. Or configure the SAP CP destinations that can be points to the on-premise backend services running in the customer’s landscape.
Note: The SAP Cloud Platform itself follows the multi-tenant application architecture for many of its services. You may have used services like the Web IDE, Portal services, IoT services for developing your applications on SAP CP. These are offered to you as subscriptions to the services running on SAP’s own provider accounts.
SAP CP Account Setup for ITeLO
Let’s take the case of ITeLO Consulting to see how the SAP CP accounts can be setup for their multi-tenant application.
Remember that Robert is the administrator of the SAP CP account on which the resources have been allotted. This SAP CP account acts as the Provider account where the multitenant application for pollution monitoring is deployed and run.
Robert then creates 2 new SAP CP accounts which act as Consumer Accounts, each one mapping to a customer – one account for ABC PetroCorp and another account for XYZ EnergyCorp. Then he creates subscriptions from these consumer accounts to the application(s) running in the provider account.
For the customer-specific configuration that needs to be done on the consumer accounts, Robert plans to collaborate with the customer organization.
‘Emily’ is an employee of the IT department of ABC PetroCorp. She has been assigned to work on this project with the Robert.
For XYZ EnergyCorp, ‘Stephen’ is an employee of the IT department who will work with Robert.
Robert adds Emily as a co-administrator of the consumer account for ABC PetroCorp and Stephen as a co-administrator for the consumer account for XYZ EnergyCorp. Afterwards, Emily and Stephen will do the required configuration in their respective accounts.
Note: It is also possible that the consumer account is completely configured/operated by the partner.
Summary:
- We started the scenario of a partner who wants to use SAP CP to deliver SaaS applications to his customers.w
- We got a high level overview of the multi-tenancy concept within SAP CP and an idea of how SAP CP accounts can be setup for the same.
Robert uses SAP CP to build such a multitenant application and this will be covered (step by step) in the following blog posts
- Part2. Application Overview- Introduction to solution, services and its architecture
- Part3. Project Setup – Create and deploy of MTAR, DB Binding and consumer subscriptions
- Part4. Persistence multitenancy – Data initialization and isolation
- Part5.1 Identity Management – Setup of SCI Tenant
- Part5.2 Identity Management – Setup of SCI Tenant
- Part6. On-Premise Connectivity service – On premise setup and configure connectivity service
- Part7. Cloud Connectivity services – Configure Connectivity services
- Part8. Fiori Launchpad – Configuring tile for multi-tenant application
Excellent !.
Thanks Jose !.
great blog – i like the future blog titles as well, can’t wait to read more
well done Anuj
Thanks a lot Sergio !
Very interesting blog Anuj...!!!
Thanks PrAvln !
Beautifully explained! Thanks 🙂
Thanks Patil!
Part 4 link to be corrected to https://blogs.sap.com/2016/12/19/developing-multi-tenant-applications-on-hcp-persistence-multitenancy-part-4/
Thanks Parag!
I have corrected this.
Well done Anuj
Thanks Meik !
Great blog. Well written.
Thanks Apoorva!
This is valuable knowledge and should be preserved.
However i am missing the sample source code that was used throughout the blog.
would it be possible to obtain the source code in order to follow along the guide?
kind regards.
Thanks a lot Stephan!
Source code is available on github.
https://github.com/AnujMehta07/cloud-pollutionmonitoringapp.git
How to import this source code and set up the project is also explain in the part3 of this blog post series.
HI Anuj,
Great article and it really aligns with what we wish to do in our company. Can you please now elaborate on what packages we need to purchase from SAP to accomplish this? Right now we have the PE Build.
Thank you,
Milly
Hi Milly Bashir
Thanks a lot!
Could you please send me a mail. I will connect with you a right person who is responsible for commercialization of packages required to build such multi-tenant application.
Best Regards,
Anuj
Hi Anuj
We are trying to create a multi tenant application using same scenario you have explained in this blog. How do we create Provider account and Consumer account. We have a paid SCP account, Do we need special license package for this account creation and to complete this scenario?
Regards
Bimal
Hi Bimal,
There is no special license package is needed for creating sub accounts for provider and consumers in your global account and to complete this scenario but you must have all services in your SCP account which are needed for this scenario.
Best Regards,
Anuj
Hi Anuj
Thank you for clarifying my doubt on Provider and Consumer accounts, we are now configuring the scenario in this blog.
Regards
Bimal
Hi Anuj,
Excellent Blog Series!
We (SAP Partner) would like to host such an Application, which currently only serves as a Frontend and all Logic happens in the SAP system. On Neo I successfully created Subaccounts with Subscriptions for to be Customer accounts. All works fine also the Destinations to the Backend.
What is unclear at the moment for me if we can host it like that or if we need SAPs ePaaS Solution.
ePaaS most likely would render that Application unprofitable due to its high initial costs.
Best regards,
Daniel
Hello Anuj, according to Gartner: "Multitenancy is a reference to the mode of operation of software where multiple independent instances of ... applications operate in a shared environment. The instances (tenants) are logically isolated, but physically integrated."
According to you: "Multi-tenancy is an architecture in which a single instance of a software application serves multiple customers".
Do you think that Garner got it completely wrong ?
Cameron
Hi Anuj,
Thanks so much for this very helpful blog!