> On 8 Jun 2015, at 23:38, Steve P <steveandjo...@gmail.com> 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 nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/F61C93AE-BF6E-4544-9AEA-EDD37D9C7032%40dinhe.net. For more options, visit https://groups.google.com/d/optout.
smime.p7s
Description: S/MIME cryptographic signature