Thank you very much Aria!! Coming from a PHP background Node is a complete change of pace!
On Monday, June 8, 2015 at 9:57:08 PM UTC-7, Aria Stewart wrote: > > > > On 8 Jun 2015, at 23:38, Steve P <[email protected] <javascript:>> > wrote: > > > > I'm working on a multi-tenant app in which each client will have their > own database, each having the identical schemas and I need to be able to > swap out the database I'm connecting to on a per request basis. I've been > able to find nothing regarding this ability as near as I can tell the db > connection is set at boot time. > > > > This is surely possible with Node, right? > > Yes! > > You're probably overthinking it: the simplest increment from 'connect at > boot time to one database' is 'connect at boot time to all the databases, > and pick the right connection at request time'. > > From there it's a small step to make that lazily connect -- if there's a > connection, use it. If not, create it and use it. > > You may want to look at connection pooling libraries in the registry. They > may help this. > > Aria > > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/40588a46-5a7e-48ec-8d39-a83351b2fc6d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
