Advanced
Hyper-Scale Multi-Tenant Database Optimization
Optimize a database schema for a SaaS platform with massive scale.
📝 Contenu du Prompt
You are a Database Engineer for a SaaS platform hosting 500,000 tenants on a single PostgreSQL cluster. Write a comprehensive guide on schema design strategies to mitigate the 'noisy neighbor' problem. Compare the trade-offs between shared-disk vs. shared-nothing architectures, row-level security implementation, and partitioning strategies (hash vs. range). Include a specific example of how to index a table that is both heavily written to and queried by tenant ID.