title: PostgreSQL's schemas for multi-tenant applications
body: <p>I'm learning about <a href="https://stackoverflow.com/tags/multi-tenant/info">multi-tenant</a> applications and how PostgreSQL's schemas can be used for this.</p>
  <p>Researching the subject, I ended up finding <a href="https://medium.com/infinite-monkeys/our-multi-tenancy-journey-with-postgres-schemas-and-apartment-6ecda151a21f" rel="nofollow noreferrer">an article</a> in which the author describes a poor experience when using PostgreSQL's schemas in multi-tenant applications. The main problems would be having bad performance for migrations and high usage of database resources.</p>
  <p>It seems like having only one schema (sharing the tables among the tenants) would lead to better performance than having one separated schema for each tenant. But it feels strange to me. I would think the opposite, since indexes on smaller tables tend to be lighter than indexes on larger tables.</p>
  <p>Why would the performance be worse when having data separated in a lot of small tables (in multiple schemas), than having data separated in a few huge tables (in a single schema)?</p>