Scalable Multi-Tenant Frontend for an E-Commerce Platform
summary
Migrates a per-tenant AWS Fargate React stack to a single Next.js site on Vercel that identifies tenants by domain via a global tenant table and a middleware fetching mapping (or optional host-header lookup), applies URL rewrites so tenant IDs stay hidden, and uses tenant-aware caching with ISR TTL 60s to avoid cross-tenant cache leakage. Implementation details, demo repo and tradeoffs (edge compute, serverless, unlimited Vercel domains, routing vs next.config rewrites) are shown, with measurable latency and onboarding gains.
AI-written summary · about
chapters (33)
- 0:00intro
- 0:22preamble
- 0:37about guilherme
- 1:01about mercloud
- 1:43what is a b2b e-commerce?
- 4:15who are the customers?
- 5:05where we started
- 5:23our mvp architecture
- 5:54constraints
- 7:11re-imagining our architecture
- 8:26the solution
- 9:02tenancy models
- 9:34isolation strategies
- 10:38benefits of a multi-tenant architecture
- 12:13technology choices
- 14:20compute at the edge
- 15:35serverless, in a nutshell
- 16:44the idea
- 17:19the challenges
- 19:46api limits?
- 20:18identyfying the tenant
- 23:51routing
- 24:39caching page outputs
- 25:12incremental static regeneration (isr)
- 27:08tenant-based routing
- 29:37solution: url rewrites
- 30:40demo time!!
- 34:55source code
- 35:54vercel platforms starter kit
- 37:42where we landed - mercloud's architecture overview
- 38:42outcomes
- 39:44lessons learned
- 43:12thanks!
related talks
37mBuilding Scalable Multi-Tenant Frontend Architecture for a B2B E-Commerce Platform
22mArchitecting Multi-Tenant Solutions with Next.js and the App Router
22mMulti-Tenant Frontend Architecture with Nuxt.js
01h 00mWhat we learned rebuilding the largest Nordic electronic retail website
35mA multisite Vue3 application for a multitenant enviromnent: a survival guide
55mWhat we learned rebuilding the largest Nordic electronic retail website in Next.js?
11mEnterprise-grade composable commerce with Next.js
22mOptimization strategies for a performant, headless storefront
