Google Groups Home
Help | Sign in
Message from discussion Multiple database usage in Turbogears
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Bryn Divey  
View profile
 More options May 13, 4:29 am
From: Bryn Divey <bdi...@gmail.com>
Date: Tue, 13 May 2008 01:29:57 -0700 (PDT)
Local: Tues, May 13 2008 4:29 am
Subject: Re: Multiple database usage in Turbogears
Thanks for the comments, everyone. I've using the "overwrite db-
session" route, and it appears to be working (along with a modified
VisitManager written by a colleague). I'll tell you how it goes (;

On May 10, 3:13 pm, Jorge Godoy <jgo...@gmail.com> wrote:

> Em Thursday 08 May 2008 11:53:33 Bryn Divey escreveu:

> > Hi all,

> > We're building an application on TG 1.0.2 using SQLAlchemy 0.3.11 are
> > are busy considering our options wrt multiple customer support. We'd
> > be hosting the app servers, and there's a low upper-bound to the
> > traffic they'll be hit with, so we're trying to figure out a way to
> > support multiple customers on a single app instance.

> > The problem is that the system is quite complex and there were
> > limitations which made making our DB schemas multi-customer rather
> > difficult. This means that we'd basically need to figure out - per
> > request - which customer we're working with, and load their database
> > up for the lifetime. An experimental solution exists which hijacks
> > things like turbogears.database.get_engine and replaces them with a
> > function which determines the correct engine to be loaded. I'm still
> > wading through it to try get it up and running again (I'm getting
> > Visit attached to incorrect session errors atm.)

> > The question I have is: is this the correct solution (or, at least, on
> > the right path)? I'd love to hear from anyone else who's tried
> > something similar and get your experience of the problem.

> I have multi-client apps (even changing the stylesheets applied to the
> templates) but I used cookies for determining which client is accessing the
> application and I have the client coded at the DB tables, i.e., something
> differentiates a row from one client of a row from another client.

> Going this route allowed me using TG as it is, without any monkeypatch or
> change, and also allows me to get the most from the database, even sharing
> common information among several clients.

> If you use PostgreSQL, I'd suggest using multiple schemas and using the search
> path to find the tables you want, then you can easily change things by simply
> changing the search path.

> --
> Jorge Godoy      <jgo...@gmail.com>

>  signature.asc
> 1KDownload


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google