Minimum scaling features on each stage of a saas production timeline.
- Rate Limit in VM (traefik/nginx): for backend+frontend, manually set req/sec.
- Db redis cache: for backend (Optional, but this always helps)
- Frontend, Backend, DB each should have their own container (Docker is ok)
Doing this would keep the product functional for atleast some users. but it is better to write tests/benchmark script to find the optimal req/sec value for the specific vm config (not sure).
- Frontend CDN or S3 deploy: now VM mostly deals with backend and DB.
- Enable Auto or Manual vertical scaling
Chokepoint: Backend & DB — Now is a right time to either use a managed kubernetes service for backend and rds for managed db or we can horizontally scale manually.
- Split DB and backend: Migrate to RDS and kubernetes respectively.
- Split DB and backend to their own VM
- Replicate and Load Balance backend VMs.
At this point db vm is the only choke point. backend easily replicates. but db only has one gaint vm.
- DB read replica and DB load balancer
- Strategic sharding (spliting based on tables, pk range, etc)
- backend spliting into microservices