Thread: Twin Adapter
View Single Post
  #1 (permalink)  
Old 03-06-2008, 03:51 PM
samguyjones samguyjones is offline
Junior Member
 
Join Date: Mar 2008
Posts: 3
Lightbulb Twin Adapter

Hello everyone! This is a first time post.

We've got a database with replication set up. In this case, we want the website to be doing all its queries from the slave databases but all its additions and alterations to the master database.

It seems to me that the easiest PHP solution is to set up a twin adapter (extension of Zend_Db_Adapter_Abstract) that takes two other adapters as arguments. All the fetch and describes get passed to the 'slave' adapter and all the insert, updates and delete methods get passed to the 'master' adapter.

In fact, this seems so simple that I'm pretty sure someone's done it. Has someone created the adapter I describe? Can anyone think of a reason why this wouldn't work or a better way of doing it?
Reply With Quote