SaaS Platform Design — Tenant Management, Billing, và Observability
Một SaaS platform không chỉ là business logic của product. Nó cần một lớp infrastructure riêng: tenant management service (onboard/offboard tenant, tenant context propagation), subscription và entitlements system (ai được dùng feature nào ở plan nào), usage metering (đo consumption để bill chính xác), và multi-tenant observability (metrics và traces có tenant dimension để debug "tại sao tenant này bị chậm").
Bài này thiết kế từng component, giải thích cách tenant context flow qua request lifecycle (từ API gateway đến database query), và cover migration patterns khi bạn cần đổi isolation model — một trong những operation nguy hiểm và phức tạp nhất trong vòng đời SaaS product.
Sẽ sớm cập nhật.