Forum: Ruby on Rails Multitenancy and the options to realise it in rails4

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ab3a425ee2c920a7c3d61984dc0ee220?d=identicon&s=25 Denny Mueller (Guest)
on 2013-09-21 13:57
(Received via mailing list)
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.
http://railscasts.com/episodes/389-multitenancy-wi...
http://railscasts.com/episodes/388-multitenancy-with-scopes

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_
Aa082c8b00a50928e5860dcd70bf2368?d=identicon&s=25 tamouse m. (tamouse_m)
on 2013-09-23 06:31
(Received via mailing list)
On Sep 21, 2013, at 6:55 AM, Denny Mueller <macdankk@googlemail.com>
wrote:

>
> This works fine right now. But yesterday I watched some railscast.
> http://railscasts.com/episodes/389-multitenancy-wi...
> http://railscasts.com/episodes/388-multitenancy-with-scopes
>
> 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_

Best suggestion here I can make is pick up Radar's book:

http://www.goodreads.com/book/show/18333875-multit...

really a great read, very helpful in this.
Ab3a425ee2c920a7c3d61984dc0ee220?d=identicon&s=25 Denny Mueller (Guest)
on 2013-09-23 18:29
(Received via mailing list)
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_

Am Montag, 23. September 2013 06:29:37 UTC+2 schrieb tamouse:
5251fb12ad96bacd1f57e579b28b30fe?d=identicon&s=25 unknown (Guest)
on 2013-09-25 14:00
(Received via mailing list)
basically you want somebody to do your reading work for you and
summarize
it for you? come on...
This topic is locked and can not be replied to.