title: How to create a multi-tenant database with shared table structures?
body: <p>Our software currently runs on MySQL. The data of all tenants is stored in the same schema. Since we are using Ruby on Rails we can easily determine which data belongs to which tenant. However there are some companies of course who fear that their data might be compromised, so we are evaluating other solutions.</p>
  
  <p>So far I have seen three options:</p>
  
  <ul>
  <li>Multi-Database (each tenant gets its own - nearly the same as 1 server per customer)</li>
  <li>Multi-Schema (not available in MySQL, each tenant gets its own schema in a shared database)</li>
  <li>Shared Schema (our current approach, maybe with additional identifying record on each column)</li>
  </ul>
  
  <p>Multi-Schema is my favourite (considering costs). However creating a new account and doing migrations seems to be quite painful, because I would have to iterate over all schemas and change their tables/columns/definitions.</p>
  
  <p><strong>Q:</strong> Multi-Schema seems to be designed to have slightly different tables for each tenant - I don't want this. Is there any RDBMS which allows me to use a multi-schema multi-tenant solution, where the table structure is shared between all tenants?</p>
  
  <p>P.S. By multi I mean something like ultra-multi (10.000+ tenants).</p>