Replicating entities to remote server (MSMQ?)

Posts   
 
    
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 20-Dec-2005 23:59:19   

Have any folks done something like this? Catch an entity as it's being saved and create an MSMQ message that eventually updates a remote server? I searched the forum for threads with "MSMQ" but didn't find much.

Seems to me one potential problem is that when I save an entity locally it's marked out of date and I might have trouble putting the entity in a message to be saved somewhere else. Another issue might be that only a fraction of the entity columns may have changed, perhaps none of the related entities, and I don't want to serialize stuff I don't need to.

I wonder if it might be feasible to simply catch generated SQL and replicate that.

pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 21-Dec-2005 00:09:18   

JimFoye wrote:

Have any folks done something like this? Catch an entity as it's being saved and create an MSMQ message that eventually updates a remote server? I searched the forum for threads with "MSMQ" but didn't find much.

Seems to me one potential problem is that when I save an entity locally it's marked out of date and I might have trouble putting the entity in a message to be saved somewhere else. Another issue might be that only a fraction of the entity columns may have changed, perhaps none of the related entities, and I don't want to serialize stuff I don't need to.

I wonder if it might be feasible to simply catch generated SQL and replicate that.

Why wouldn't you use SQL Replication to do something like this?

BOb

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 21-Dec-2005 00:46:48   

Clients won't have SQL Server. They'll have MSDE.

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 21-Dec-2005 00:51:41   

Well, I forgot MSDE supports replication, but with some limitations.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q324992

I just quickly skimmed this - not sure of the ramifications of this for my situation. I need to look closer into it.

Meanwhile, let's assume I want to do something myself, probably with MSMQ...

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 21-Dec-2005 00:55:17   

Also of note, I believe that MSDE's replacement, SQL Server Express, may further limit replication abilities...seems like MS wants to curb the freebies is this department.

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 21-Dec-2005 00:57:59   

You could take advantage of the Notification stuff in sql express, thats prolly how i am going to implement something similar, although i dont know if i can tell you what changed on the field level..

pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 21-Dec-2005 21:45:09   

JimFoye wrote:

Clients won't have SQL Server. They'll have MSDE.

MSDE on both sides?

SQL Express supports replication as the subscriber.

Anyway, you can log all the SQL sent to the server and ship the logs. This is actually close to what one of the SQL methods does.

BOb

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 21-Dec-2005 22:33:57   

There will be a central server, and then numerous clients at remote locations running MSDE, guess I should have been clear about that from the beginning simple_smile .

I remember now MSDE doesn't do transactional replication.

I'm inclined to just roll my own replication scheme. My main concern going from server to clients is just to push out new values in lookup tables. I'm thinking about capturing the SQL that LLBLGen outputs and sticking that into a message in an MSMQ queue. Could maybe handle minor schema changes that way, too.

Going the other way, clients mainly need to push up everything associated with a certain project. Might just brute force that one with remoting. User chooses to upload project, I load up the entity with all related entities, send to server, and when it gets there my server code just deletes it if it exists in the server db, and inserts everything.

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 22-Dec-2005 11:15:52   

There will be a central server, and then numerous clients at remote locations running MSDE, guess I should have been clear about that from the beginning.

Guess you are looking at a pub-sub messaging senerio.

One way of doing this could be to serialise to xml the entity, pack that as a message to your remote client, and then unpack back to entity at the other end and apply it.