简体   繁体   中英

SQL Server replication at the software level?

I have a need to make a remote connection through a DSL line (getting about 16k/s) to a SQL Express 2005 instance much faster.

I think I can do it by having a SQL Express 2005 instance on the client's local machine and have it be a cached version of the data on the server.

I'm planning to allow changes to the remote server only and then require the user pull down updates from it occasionally. It's not ideal, but it'll work.

So, does SQL Express support me querying across the network something like:

INSERT INTO local.dbo.users (id, username, email, timestamp_modified)
    SELECT remote.dbo.users(id, username, email, timestamp_modified) 
        WHERE remote.dbo.users.timestamp_modified > LAST MODIFIED

For one you can use real Replication. You should also look into Service Broker. Both allow you to push the data from remote to a SQL Express instance. Service Broker performs and scales much better, is proven to work over slow DSL connections, but has a steep learning curve. Replicaiton is easy to set up but you'll have to live with it's limitations.

Using linked servers like you plan is not going to work. Is unreliable, slow, and doing updates over a linked server requires you to set up distributed transaction.

Why write something that has already been built and is available to you with the product you already have installed?

You should look into Log Shipping over your DSL line. It is a very reliable SQL Server product and has been tested extensively.

http://msdn.microsoft.com/en-us/library/ms187103.aspx

Although the express edition does not have SQL Server Agent, there are workarounds that you can use:

http://blog.willbeattie.net/2009/07/log-shipping-in-sql-server-express-2008.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM