- I wanted to keep global user data in one database and org data in separate database
- I want to use Sequel models in the same way as I was using a single databases
- I need simple interface to define that model data resides in Organization and not Global DB
Only possible solution I found is by patching Sequel native methods. If anyone knows better way to do it, like injecting DB connection just before dataset executes a query, please comment and explain.
I tried to use "sharding" and "arbitrary_servers", but that is not what I want. I have 1000nds of orgs, and 1000nds of DBs. I need connections to be fuly dynamic and I want to define request context once when request starts in Thread.current.