Alessio.Bussolari
Alessio.Bussolari

Reputation: 63

best way for menage the data on rails app

I need to create a big database where I've a lot of user end every user can store a million of row in a DB, My question is, I can make (In rails) one system where every user have a own DB ? for example one general DB where i can store the user and a lot of db where the user can store the data, or isn't good for the speed of my rails app ?

Upvotes: 1

Views: 139

Answers (1)

Ivan Santos
Ivan Santos

Reputation: 636

You can use Postgre Schemas for each user. http://www.postgresql.org/docs/9.0/static/ddl-schemas.html

  • It's common used for multi-tenancy applications where you have an app created to server a lot of "accounts" where those accounts have a lot of users.
  • Pretty much they'll have the same tables but the data are separated by schemas.
  • I'm not sure but in the future you can scale and balance the schemas in different servers.

Here's some approaches on this gem: https://github.com/influitive/apartment

Upvotes: 2

Related Questions