in models you can do something extending Zend_Db_Table On Wed, Jun 24, 2009 at 8:46 AM, wadearnold <[email protected]>wrote:
> > I'm looking for a sanity check for my ZF connection to a mysql master/slave > architecture. My Db configuration is MySQL Master and three slaves. The > three slaves are behind a load balancer with linux hearbeat so to php the > slaves are a single connection. To date I have been using two Zend_Db > connections and then remembering in my code were to read and write: > > // using mysqli adapter > $master_db = Zend_Db::factory(...); > $slave_db = Zend_Db::factory(...); > > $master_db->insert(...); > $master_db->beginTransaction(); > $master_db->update(...); > > $slave_db->fetchAll(...) > $slave_db->select(...) > > > I have seen other frameworks abstract the first part of the sql statement > and find the proper db pool. I am not sure if this is worthwhile and seems > like a lot of work for PHP. There is not an equivalent in the Zend > Framework > correct? > http://solarphp.com/class/Solar_Sql_Adapter_MysqlReplicated > > I am starting a large application and don't want to come begging back to > the > list when it does not work. Does my implementation seem sufficient? Links > to > best practices would be great! > > -- > View this message in context: > http://www.nabble.com/Best-practice-for-Master-Slave-Db-w--ZF--tp24179039p24179039.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- victor http://apostolvictor.info
