Multitenancy and the options to realise it in rails4

80 views
Skip to first unread message

Denny Mueller

unread,
Sep 21, 2013, 7:55:29 AM9/21/13
to rubyonra...@googlegroups.com
Ok the situation is that I have an App, where to user can sign in and can use the app save some data like customers and orders to the db. 
Since I'm using devise for authentication, I realised the multitenenacy with current_user in the controller. So every user has his own data.

like 

  def index
    @customers = current_user.customers
  end

etc 

This works fine right now. But yesterday I watched some railscast.

As you can see the first one uses pg schemas and the second one works with scopes. Both have the same effect like my way. But what could be the advantages or disadvantages to these 3 ways? Dont want to build further on my app and realise in the end that I picked the wrong way. Maybe in the end of the app there will be a function user can team up and have shared data... but this is just a nice to have.

Any experince, hints or suggestion on that?

best regards
denym_

Tamara Temple

unread,
Sep 23, 2013, 12:29:37 AM9/23/13
to rubyonra...@googlegroups.com
Best suggestion here I can make is pick up Radar's book:

http://www.goodreads.com/book/show/18333875-multitenancy-with-rails

really a great read, very helpful in this.

Denny Mueller

unread,
Sep 23, 2013, 12:28:01 PM9/23/13
to rubyonra...@googlegroups.com
Yeah I already found this, but I dont want to digg a complete book about this topic, a kind of summary or a discussion about it would be nice.

regards
denym_

and...@benjamin.dk

unread,
Sep 25, 2013, 7:59:02 AM9/25/13
to rubyonra...@googlegroups.com
basically you want somebody to do your reading work for you and summarize it for you? come on...
Reply all
Reply to author
Forward
0 new messages