Case study 01 Multi-tenant SaaS
Together CRM
A production B2B CRM serving multiple business clients — an API gateway in front of roughly twelve domain services, with every tenant's data in its own database.
fig. 01 — gateway + domain services · db per tenant
01
The problem
Business clients needed one CRM that felt like their own: their data isolated, their permissions respected, and their teams updated in real time.
As the product grew, so did its capabilities — contacts, messaging, notifications, background processing and integrations. The platform had to keep adding features without letting one tenant's data, load or failures leak into another's.
02
My responsibility
- 01Feature ownershipTook features from product requirement through API design, UI implementation, deployment and validation.
- 02Service designDefined service boundaries, REST APIs and RPC contracts between domain services.
- 03SecurityImplemented authentication, RBAC/ABAC authorization and strict tenant isolation.
- 04ProductionDeployed with Docker on AWS behind Nginx and PM2, and investigated and fixed live issues.
- 05QualityLed CRM testing and quality validation with 50+ Google developers through a Technion QA partnership.
NoteTogether CRM was built by a team. This page describes the parts I owned or co-owned, at a level of detail that doesn't expose internal implementation.
03
The architecture
A request enters through the Express gateway, which authenticates the caller, establishes tenant context and routes to the owning domain service. Services talk over REST and RPC, hand long-running work to RabbitMQ, use Redis for caching and coordination, and push updates to connected users through Socket.IO.
04
Engineering challenges
Isolation without duplication
Every service must read and write only the current tenant's database — without each feature re-implementing tenant handling.
Authorization everywhere
Role- and attribute-based rules have to be enforced consistently across a dozen services.
Real-time without cross-talk
Messages and notifications must reach the right users of the right tenant, and nobody else.
Fast APIs, heavy work
Imports, notifications and integrations can't block request/response cycles.
Debugging across hops
One user action can touch the gateway, several services, a queue and a database.
Confidence under load
Critical endpoints need evidence, not assumptions, before traffic grows.
05
The solution
- Resolve context once, at the edgeThe gateway authenticates the request and establishes tenant and user context, which travels with the request to downstream services.
- Database per tenantEach tenant has its own MongoDB database, so isolation is enforced by where data lives — not only by query filters.
- Centralized authorizationRBAC/ABAC checks are applied consistently, keeping permission logic out of individual feature code.
- Asynchronous by default for heavy workBackground jobs run through RabbitMQ; Redis handles caching and coordination between instances.
- Scoped real-time deliverySocket.IO delivers messages and notifications only to the intended users within a tenant.
- Measure before trustingk6 load tests exercised critical endpoints, and production issues were traced through logs across services.
06
Technologies
07
Outcome & lessons
The platform runs in production for multiple business clients — and taught me that most reliability is decided by early architectural choices.
- Isolation decided at the data layer is simpler to reason about, review and explain.
- Clear service contracts matter more than the number of services.
- Queues and caches buy speed only when you can see what they are doing.
- Load tests and real production debugging teach different lessons — both are needed.