Scale multi-tenant SaaS with per-tenant version pinning using Amazon CloudFront
.NET on AWS Blog
This article demonstrates how to scale multi-tenant SaaS applications using CloudFront multi-tenant distributions with per-tenant version pinning, enabling zero-downtime version switching without Application Load Balancer scaling constraints.
- Use CloudFront multi-tenant distributions with a version parameter to route each tenant to their pinned version (ga, preview, canary)
- Store tenant configuration in DynamoDB with domain as partition key; DynamoDB Streams trigger Lambda to reconcile CloudFront distribution tenants
- Deploy per-version ASP.NET Core services on Amazon ECS behind a fixed set of Application Load Balancer path-based rules
- Onboard tenants with a single DynamoDB write; switch versions with a single update—no infrastructure changes required
- Resolve tenant identity from the Host header in ASP.NET Core middleware; lookup tenant configuration in DynamoDB with caching
- Supports multi-region extension using DynamoDB global tables and regional origins in CloudFront
This approach eliminates per-tenant load balancer rules and certificates, scales to 10,000 tenants per distribution, and enables instant zero-downtime version switches.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
2024
2025
2025
2026
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.