When using traditional application servers and integration middleware, developing a multi-tenant SaaS application that meets SaaS requirements (i.e. personalization, tenant dimensions, self-service, resource optimization, and data aggregation) is a non-trivial exercise. The prior blog post in this SaaS series describes the requirements and constraints for SaaS applications.
Because WSO2 Carbon based middleware servers contain a tenancy framework, development teams may rapidly migrate single-tenant web applications into multi-tenant SaaS applications. WSO2 Carbon creates a multi-tenant environment inside the middleware servers (i.e. application server, integration server, Enterprise Service Bus) and delivers unparalleled tenant density. For more information on the cost and effort savings, read the multi-tenant, shared container PaaS white paper.
The WSO2 Carbon framework creates tenant partitions, registers tenant specific applications, provides tenant administration tools, and holds run-time tenant context.
In this blog post series, we will deploy a tenant-aware SaaS application on the WSO2 Application Server 5.1, illustrate how to acquire the Carbon Context object, and demonstrate multi-tenancy in action. The WSO2 Application Server is based on Apache Tomcat, and extends Tomcat with enterprise security, logging, management, clustering, and multi-tenancy; turning the open source Apache Tomcat project into Enterprise, Cloud-Native Tomcat++
Step 1 – Deploy Carbon and Acquire Carbon Context
The SaaS application demonstrates tenant-specific framework objects, illustrates tenancy isolation, and reviews the Java Tenancy API within WSO2 Carbon. The application code is available from GitHub at https://github.com/karux/CarbonSaaSTest.git
The Carbon Context object holds registry, cache, queue, user realm, and role based access control (RBAC) information for each tenant run-time context. Each SaaS application can use a Carbon platform API to access context details and personalize the application experience.
This blog tutorial and example code demonstrates the following getting started concepts and steps:
- Getting Started #1 – Defining a Tenancy Dimension Model
- Step 0: Deploy the WSO2 Application Server and start server
- Step 1: Log into the Carbon administration console as the super-administrator
- Getting Started #2 – Provisioning SaaS Applications
- Step 0: Compile the CarbonSaaSTest Application
- Step 1: Provision a Global Tenant Scope SaaS Application
- Getting Started #3 – Acquire Tenant Context