2009/6/24 wadearnold <wade.arn...@t8design.com>: > > 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!
I would suggest doctrine, its far more mature than Zend_Db and has support for what you are looking for, plus doctrine 2.0 (not released yet though) should have good support for domain modeling... > > -- > 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. > > -- ---------------------------------------------------------------------- [MuTe] ----------------------------------------------------------------------