good practice for multitenancy

19 views
Skip to first unread message

KS

unread,
Sep 8, 2015, 12:16:38 PM9/8/15
to chicagoboss
1. Would appreciate if anyone can share any successful implementation of multitenant system.

2. Right now to initial a database, we need to define model(id,xxx,xxx...). After that, is it possible that user add column and add to the database?

Thank you.

Graeme Defty

unread,
Sep 11, 2015, 5:55:07 AM9/11/15
to chica...@googlegroups.com
I am not sure we have the same definition of 'multitenant' but I have implemented a system which supports multiple (sports) clubs on a single instance of the software and single database. I would be happy to share with you how I did it.

I dont have time now for a lot of details, but basically I gave each site its own prefix which is an internal identifier for the club. so the users see URLs such as:

  club1.mysite.com
  club2.mysite.com
  . . .

The in deriving the user credentials I examine the URL to determine which club's sit the user is currently viewing and use the appropriate database records and club configuration (although the application is the same for all clubs I do allow a certain amount of configuration for branding - colours etc.  I do plan to do more in this are with perhaps different club-selectable skeletons - but it is low on the priority list at the moment)

The club so derived also determines the user's permissions on the site. Permissions are allocated in a role-based manner with an administrator in the club defining the roles for that club and which permissions are given to which roles.

Users, however, are across clubs, so a user who is a member of more than one club does not have to log out and back in to flip between clubs.

I have not said much about how I did all this (or whether I would claim any of it as 'best practice' - whatever that means) but it is working in a (very low volume) production site and doing the job.

If there is an interest in this I could perhaps write it up. I hoped to extract the role-based authorisation into an easily adoptable package, but allocating time for this is a challenge at the moment.

graeme





--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/tencent_74B31AD40FE12BB321037991%40qq.com.
For more options, visit https://groups.google.com/d/optout.

KS

unread,
Sep 14, 2015, 7:58:32 PM9/14/15
to chicagoboss
Hi Graeme,

Thanks for your sharing. It helps.


Reply all
Reply to author
Forward
0 new messages