If you are using a UUID for the primary key, do you really need an integer?
We had a similar multi-tenant need and didn't want to leak usage information to the users, so we used UUID instead of auto incrementing integers. On Dec 15, 2010, at 9:23 AM, Hutch wrote: > Hi, > > I'm porting an old php app and have run into a bit of an issue. The > main problem is that we this app will need to be used by multiple > different companies. While I could just setup discreet instances, I'm > thinking that making the app multi-tenant would be a much wiser idea > and easier on resources, as traffic will be reasonably low, maybe > 100-200 users a day. I also don't desire to deal with 4 installations > of the code, when one will do. > > The specific problem I have though, is in the legacy app, the primary > key for a certain table is an auto incrementing integer. This needs be > kept separate for each tenant. What I'm planning on doing is making > the primary key a uuid, and using unique_together with an integer > field. However I could easily see a race condition with incrementing > the integer field. What is the best way to handle this situation? > > Also, what is the best way of filtering based on the site_id? should i > store a setting with the session and filter based on that? I was > thinking about seeing if it's possible to use a middleware to change > it at run time based on the request url. Is that a good idea? > > are there any documents on best practices for django multitenancy? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.