Hi all!

For my multi tenant application i am trying to work out how i can make 
connection pools per tenant. While stil using 
one rails app.

Advantages of making it possible to connect with different 
usernames/credentials per request.

- With supplying a per-request user. We can force database level security 
(for instance schema based isolation)
- With supplying per request user connection. we can force the postgres 9.5*. 
row level security.*

This boils down to being able to have a connection pool per 
user/tenant/connectionspec in active record.

*Unfortunately this is extremely difficult thing to do:*

Right now i've monkey patched* connection handler *in order to create 
separate connection pools per tenant. But of course
this is really sup optimal. I see a couple of things that could be done to 
make this extensible for once and for all:

- Make it possible to make connection handler pluggable. I've tried to do 
this, but documentation is lacking and i can't seem to get it work.
- Make it possible to create connection pools based on specs. 

There are a couple of gems like apartment, multidb and other which are just 
bunch of difficult monkey patches in order to get
this desired behavior.

I hope i made myself clear a bit,

- Emile


 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to