// CASE STUDY
Multi-Tenant Scheduling SaaS
A horizontally scalable booking platform serving multiple clinic tenants with WhatsApp reminders and M-Pesa payments.
- .NET 8
- ASP.NET Core
- C#
- PostgreSQL
- Redis
- Entity Framework Core
- Hangfire
- Background Workers
// THE PROBLEM
The problem
A healthcare operator needed to unify appointment scheduling across independent clinic tenants, each with their own rules, staff, and patients — while sharing infrastructure costs and enforcing strict data isolation.
// APPROACH & KEY DECISIONS
Approach & key decisions
Designed a schema-per-tenant PostgreSQL model with row-level security for data isolation without operational overhead.
Built async worker pipeline (background jobs) for appointment reminders delivered via WhatsApp Business API.
Integrated M-Pesa STK Push for session fee collection at booking time with idempotent payment reconciliation.
Implemented Redis-backed distributed locking to prevent double-booking across concurrent requests.
Exposed a multi-tenant REST API with JWT + tenant-scope claims; each tenant scoped to its own subdomain.
// ARCHITECTURE
System architecture
// STACK
Technology stack
Core
- .NET 8
- ASP.NET Core
- C#
Data
- PostgreSQL
- Redis
- Entity Framework Core
Async
- Hangfire
- Background Workers
Integrations
- WhatsApp Business API
- M-Pesa Daraja API
Infra
- Docker
- Linux VPS
// METRICS
Key metrics
- Tenants supported—sample
- Appointments processed—sample
- Reminder delivery rate—sample
- Payment success rate—sample
// GET IN TOUCH
Have a similar problem?
If your system needs the same kind of thinking — architecture, integrations, scale — I'd like to hear about it.
Open a ticket →