Ir al contenido
All cases

1 instance → N clients · Mass communication industry

Omnichannel messaging

Multi-tenant platform on top of WhatsApp for retail

webhook → tenant
POST /webhooks/whatsapp
phone_number_id1049…
tenantclient_b
inboxisolated
sidekiq · redisqueued
postgres.transactionok

The problem

Each client needed its own WhatsApp number and its own inbox, on a single shared instance. Standing up a full installation per client multiplied servers, updates and certificates.

The decision

Resolve the tenant at the edge, by phone number identifier, before the webhook touches the application. Anything that cannot be left half-done lives in PostgreSQL.

Routing by phone number identifier

Every inbound webhook is resolved to its tenant before touching the application. Onboarding a new client goes through Meta's Embedded Signup, with no manual steps.

Atomic logic in PostgreSQL

Operations that cannot be left half-done live in the database, with constraints and transactions, preserving integrity under load instead of trusting execution order.

Docker, Caddy and Sidekiq

Container orchestration, TLS and reverse proxy with Caddy, and asynchronous pipelines in Sidekiq on Redis for everything that must not block a request.

The result

Real multi-tenancy without duplicating infrastructure: 45 accounts on a single instance, and onboarding a new one stopped being a full deployment.

45

Accounts in production

+500,000

Inbound messages per month

1

Instance for all of them

Tech sheet

Role
Backend Lead. I design and maintain the platform's backend.
Project base
Self-hosted open source platform, in Ruby on Rails, which I extend
Data and queue
PostgreSQL with atomic logic · Redis · Sidekiq
Infrastructure
Docker and Docker Compose · Caddy · self-hosted VPS
Integrations
WhatsApp Cloud API · Meta Embedded Signup · n8n · Evolution API
Clients
Retail. Under a confidentiality agreement, I do not name them.

Next case

Skin Studio

Appointments and e-commerce built end to end, with the business rules in the domain

Shall we work together?

Let's talk.

I design it, build it end to end and take ownership of keeping it running. Write to me and let's talk. I reply the same day.