We shipped our SaaS product with a single audit_logs table that had a tenant_id column. Seemed fine. Every query filtered by tenant_id.

We had an index on it. Done. Then a customer's admin found another customer's audit events in their activity feed. That was the worst Slack message I've ever received on a Friday afternoon.

And it was entirely our fault. How the Data Leak Happened The bug was em