DEV Community

A dive into database multi-tenancy in Elixir with Ecto

Iván González Sáiz on July 18, 2018

Some time ago I had to tackle the migration of an application with a regular database to a multi-tenancy one, and I would like to share my experien...
Collapse
 
olshansk profile image
Daniel Olshansky

Do you know if there's a way to use the prefix option with Postgres, but have it point to different databases?

Collapse
 
dreamingechoes profile image
Iván González Sáiz

Hi Daniel!

I think is not possible to change between different databases using the prefix option with Postgres. If you check the official documentation, you can read: "For Postgres users, this will specify the schema where the table is located, while for MySQL users this will specify the database where the table is located". Postgres uses its schemas for the multi-tenancy, not different databases.