We Built a Django App Serving 10k Mobile Users, 2k Admins, and 30 Companies – Here’s What Worked
We started with a single monolithic Django app that was buckling under API traffic and ERP sync jobs.
Here’s how we turned it into a lean, scalable platform.
The Scope
Our platform now:
- Serves 10,000+ active mobile app users daily
- Powers an admin portal for 2,000+ staff
- Runs 30 different company logics with their own ERP integrations
We needed a setup that could scale independently, keep costs under control, and securely isolate tenants.
The Architecture That Worked
1. API/Web separated from Workers
We split the API/web layer from background workers.
Web pods scale on traffic spikes, workers scale on ERP sync queue depth.
This means heavy data processing never slows down API responses.
2. Multi-tenant PostgreSQL (RLS)
We chose Row-Level Security for tenant isolation.
It’s secure, easier to manage than schema-per-tenant in our case, and allows shared migrations.
3. Celery + Redis
Our ERP syncs run hourly per tenant. Celery workers handle:
- Heavy data imports
- Parsing and bulk upserts
- Notifications
4. API Gateway
We placed an API gateway in front of Django for:
- Auth
- Rate limits
- Request shaping
5. S3 + CDN
For media and assets. Redis is also used for:
- Session store
- Caching hot queries
6. Observability
- Sentry for errors
- Prometheus + Grafana for metrics
- ELK stack for logs
7. Zero-downtime deploys
Feature flags let us roll out new ERP parsers without breaking production.
Results After 6 Months
- ~30% lower cloud spend compared to monolithic scaling
- 5–7× faster ERP syncs thanks to bulk upserts & isolated worker scaling
- Zero cross-tenant data leaks
- New company onboarding in < 2 days
Key Lessons Learned
- Separate workloads early – Scaling API and workers independently saves money and avoids performance bottlenecks.
- Invest in observability – Catching issues early is cheaper than firefighting later.
- Multi-tenancy design is critical – Choose your isolation model carefully; it’s hard to change later.
- Feature flags are invaluable for safe rollouts.
Curious how others have scaled Django for multi-tenant apps — what’s your go-to trick?