Serverless SaaS on AWS and Multi-tenancy

Ritesh Sharma
3 min readJan 23, 2023

--

While migrating Legacy applications to Cloud, customers are looking for multiple benefits

1. Faster time to market
2. operational efficiency
3. Get Software as a Service to reduce the CAPEX Requirements

Providing SaaS and in a multi-tenant environment is a challenging activity for many Software providers. This involves a mix of strategy that will need to align tenant activity with the consumption activity.

Serverless Model provides a compelling fit for providing SaaS to allow customers to leverage benefits of Auto-Scaling and pay per-use.

AWS Bucket of Serverless services consist of few services listed as follows Amazon API Gateway, Amazon Cognito, AWS Lambda, Amazon DynamoDB, AWS CodePipeline, Amazon CloudWatch etc.

Two supported deployment models for SaaS can be envisioned as follows

· Silo (each tenant its own set of infra resources)

· Pool (all tenant share common storage and computing infra)

These two deployment models can be partitioned in to 3 tiers of service for a customer eg Basic , Standard and Premium ( Silver , Gold , Platinum) depending on the customer requirements for exclusiveness of the services.

Also, few Key Modules / Components required for a Multi-tenant SaaS solution would entail

  1. Registration
  2. Onboarding
  3. Tenant Isolation
  4. Data Partitioning
  5. Tenant Deployment Pipeline
  6. Activation
  7. Observability

These two deployment models impact / influence onboarding, isolation , noisy neighbor , performance and tiering profile of a serverless SaaS Environment.

Please refer to a baseline environment for sample serverless application GitHub — aws-samples/aws-saas-factory-ref-solution-serverless-saas

Different Modules in the sample application

  1. Frontend — eg built using angular ( landing page , admin console , sample saas application
  2. Shared Services — responsible for the onboarding, tenant, and user management aspects of the application
  3. Application Services — business functionality of the application
  4. Multi-tenant Data Storage — tenant data is stored in shared DynamoDB Database
  5. Microservices boundary — API Gateway provides this boundary later for the microservices , backed by Lambda Functions for all the CRUD operations on a particular module

Application API’s

The application and shared services of the serverless SaaS environment are accessed through the API Gateway. The baseline infrastructure creates the resources, methods, and lambda functions necessary to create and deploy our microservices.

Serverless Microservices

Represented below is a collection of functions that represent a logical microservice which is bounded by the API Gateway , backed by Lambda Functions

Typical flow for a microservices module in AWS

Usage Plans & Reserved Concurrency by Tenant Tiers

SaaS providers provide different experiences through variation in throttling , which is time multiplexed , so that the applications with base tier are not able to interfere in the multiplexing of platinum tier tenants. API gateway allows to create usage plans for each tenant.

Also one more thing to keep in mind is the concurrent execution limits of lambda which can be modified according to the tier choosen.

Shared Services

Tenant Registration and Onboarding
User Management
Tenant Management
Tenant Privisioning

Pooled Application Services

--

--

No responses yet