开发者

Synchronising Database in web and desktop application?

开发者 https://www.devze.com 2023-01-02 16:45 出处:网络
I am trying to develop a web application(Using ASP.NET and c#) that uses a specific database hosted on web server. I will have another desktop application that will use a local database. Both database

I am trying to develop a web application(Using ASP.NET and c#) that uses a specific database hosted on web server. I will have another desktop application that will use a local database. Both databases have same structure and data at start up. Then databases will change when users add data to web application and an employee adds data to the desktop application. After a wh开发者_JS百科ile I have to sync both databases.

  • What will be best way to do this?
  • Is there any opensource example/ starter kit to start with?

    Thanks.


    Interesting question:

    Synchronising data can get quite complex as overwriting data updated by other uses can easily happen, especially if this is done by table row. Ideally you would have a last updated date on the row for each field creating latest-wins scenario when synchronising with the online database.

    A simple workflow, keeping things simple:

    The online database would be the master database, where each desktop will sync from time to time, I guess the desktop will need to send all changes since the last sync date to update the Master and then download all records (new and updated as these could have been changed by other users) from the Master from that last sync date.

    If the desktop is connected to the internet, it might be worth connecting directly to the database. Alternatively if its a laptop thats on the go, I guess the sync setup would be required.


    With just knowing the high level requirements you've given, I would suggest you look into the Microsoft Sync Framework http://msdn.microsoft.com/en-us/sync/bb821992. I've used it on smaller applications and have had great success with it.


    You requirement seems to me like have different presentations of the same application for different users. Some connected to Web and some to Desktop. Is it not possible to have a single database ( assuming you are on the network where database server is present and can access the same) for both web and desktop.

    Did you think of developing it with a smart client approach? I read that it does give us offline data cache capability.

    Here is some MSDN link: http://msdn.microsoft.com/en-us/library/ms998473.aspx

  • 0

    精彩评论

    暂无评论...
    验证码 换一张
    取 消

    关注公众号