views:

330

answers:

1

Does anyone have any experience with working with DevExpress' XPO in an environment where the DB is replicated? From my previous question here and one on serverfault, I think it's been decided that replication is the way to go.

The MySQL docs say that all writes need to happen on the master, and all reads have to come from the slave. This makes sense, but now it's a matter of setting up XPO to write to the master (far away), but read from the slave (local).

I received a good response on the DevExpress forums about how it could be done, which I intend to attempt, but I'm wondering if anyone HAS done it, and any insights/gotchas/references they would have.

+4  A: 

EDIT: since you don't like the first approach.

here are some master-master replication links in case you haven't seen them.
http://forums.mysql.com/read.php?144,235807,235807
http://code.google.com/p/mysql-master-master/
http://www.mysqlperformanceblog.com/2007/04/05/mysql-master-master-replication-manager-released/ http://www.howtoforge.com/mysql_master_master_replication

Some potential wikipedia entries. http://en.wikipedia.org/wiki/Replication_%28computer_science%29#Database_replication
http://en.wikipedia.org/wiki/Multi-master_replication


Mysql Replication Solutions (Cached from google, the original link is now dead for some reason)


Have you tried the method suggested on the DevExpress forum yet? That's how I would do it.

From Alian Bismark Here

  1. Create SessionA
  2. Call SessionA.Disconect() - Set ConnectionString to SessionA and call SessionA.Connect()
  3. Create SessionB
  4. Call SessionB.Disconect() - Set ConnectionString to SessionB and call SessionA.Connect()
  5. Load obects from SessionA, using XPCollection auxL = new XPCollection(SessionA)
  6. Create objects of SessionB, using B b = new B(SessionB)
  7. Assign fields from object A to object b 8 Save object b

this approach work well with basic objects, if you have relationships etc, you need to resolve the references of objects in session B, using the info of objects of session A.

Robert Greiner
No I haven't, and don't think I will. Too much hackery involved. I've opted for master-master replication in mysql unless a better solution presents itself.
SnOrfus
yeah, I agree about the hackery. Although, I think it is a legitimate way to accomplish what you need.
Robert Greiner
I added some more links for you, I'm not sure if you have seen them or not, although you probably have.
Robert Greiner
+1 for the good google code link, which I hadn't seen yet, the rest I had (and the first link is broken, but I've read the mysql replication docs).
SnOrfus
wow, that link worked yesterday, I went back to google and found the link to the cached pages, I don't know if it is what you need, but I figured it wouldn't hurt to have it here.
Robert Greiner