Well, I don’t know how many parts this will have… so lets just say 5 until I re-edit the introduction.
Thomas Edison told us how to invent. So let’s get to it. The Adapter we’ll build will assist in handling the problem of database-failover in Rails 2.3.2 applications
Seamless Database Pool gem provides us with a template to follow. The SDP is focused purely on connection logic. The true db adapter is used within the pool connections. Our Adapter, like SDP, will simply serve as a proxy to handle the event when an ActiveRecord method (#select, #create, #update, #delete) encounters a DatabaseConnectionError.
Ok, we’re going to have to work for it this time. Event though we have SDP as a template, there is A LOT of logic in there that is really not useful to us. SDP is a load-balancing pool based upon a weighted one-write/many-read database cluster / replication group.
Ahh, the real meat of our cookout.
In my next post, we’ll start with #1 Configure Master + Slavees in database.yml