A Dive into Active Record Connection Pools and Horizontal Sharding in a Gem
Too Long; Didn't Read
The author provides this code and software “AS IS”, without any warranty of any kind, express or implied. The author is not liable for any claim, damages or other liability in connection with the software or code provided here. The solution we arrived at below has only been tested with puma. It is not always a great idea but accessing the undercover power and capabilities of Rails can make a lot of sense when the alternative is a whole lot more challenging. The solution is only a solution for active record 6.0 so we upgraded our gem to 6.1.