bpot/data_fabric — pull request #2 by jason-o-matic (2012-02-27 21:13:08+00:00)
Title: Connection re-use

We were running into connection limit issues with mysql when using multiple :shard_by values. We're sharding different models differently, but to the same set of shards, so we end up duplicating connections that are the same for all intents and purposes. I made a change that searches through shard_pools looking for an connection to the same DB before creating a new connection. This reduced our number of DB connections by half.

I also added a test for this. In order to ease my life when testing I setup everything with bundler, which I'm hoping you'll pull in as well.

Thanks,
Jason