Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
susan b buffering
Nov 14, 2016

Why do you think you need a dynamic schema? What you described has a pretty natural database model and would be pretty bad in an eav table.

Adbot
ADBOT LOVES YOU

susan b buffering
Nov 14, 2016

a few DRUNK BONERS posted:

Does anyone have any ideas / examples of how to design a project with different databases for different users? The idea is you would log in with username / password / group code and then be in a different database based on the group code (with no shared auth, each database has its own auth table). Database routers have no access to requests. There's some bullshit online about using thread local variables which seems dumb and fragile. Possibly this isn't something that Django can handle with a basic single server setup but maybe there's something I'm missing.

Is this the thread local variable solution you’re referring to? Because it doesn’t look terribly unreasonable for the constraints you laid out.

I don’t think there’s really gonna be a “clean” solution to this problem because the level of segregation you’re talking about is usually achieved by having a separate instance of the application for each database, which might be worth exploring even if you are constrained to a single server.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply