Design a Multi-Tenant CRM Record Store
HardSystem design · Multi-Tenant SaaS · SalesForce
Design the core data platform of a multi-tenant CRM like Salesforce. Hundreds of thousands of tenants define their own objects (accounts, contacts, opportunities, custom objects), fields and relationships at runtime, query them, and control who can see which rows. Focus on the metadata-driven physical layout, indexing flexible columns, tenant isolation and noisy-neighbour limits, row sharing and field-level security, audit history and online schema changes. Out of scope: the workflow engine and the reporting UI.
Requirements
- Store records in a generic metadata-described layout rather than a table per tenant object
- Index flexible columns with typed pivot structures under a per-tenant budget, with a tenant-aware query planner
- Enforce tenant isolation in every key, row visibility via sharing rules, and field-level security in the query plan
- Apply governor limits, append an audit history on every write path, and migrate schemas online