[★]. Net occasional connection design policy-online status-offline mode-Data Synchronization

Source: Internet
Author: User

Occasionally Connected design strategies

Occasional connections can improve user productivity. Users working in low bandwidth or high latency networks, or users in connected networks, can work offline, when the network bandwidth usage is low, you can submit your work online to improve the effective usage of the enterprise network.

Occasionally Connected system design involves two main methods: Data-oriented and service-oriented.

1. Data-oriented
Data-oriented design is to install a relational database system on the client, such as SQL Server Personal Edition or SQL Server Desktop Engine (MSDE)
He can use the built-in functions of the database system to send locally changed data back to the server, detect and solve any data conflicts, and effectively process the data synchronization process. This method can save the time for developers to write and solve database conflicts.CodeMost events.

Occasional data-oriented connection design is suitable for two-tier applicationsProgram. The business logic of the Windows Forms and clients that constitute the user interface, including the database in the client. after the client is connected, the changed data is copied to the Enterprise Server Based on the defined data business logic and transmission protocol, and the changed data on the server is synchronized to the client in the opposite direction. this method is suitable for small applications. It only uses the built-in data replication and Coordination conflicts mechanism. Therefore, the implementation is relatively simple, and the disadvantage is that the database program must be deployed on the client, in this way, you need to consider the cost of local database deployment.

2. Service-Oriented
The service-oriented method is to store information in messages or use local XML files when the client is offline. after the client connects, messages stored in the message queue offline will be sent to the server for processing. if an XML file is used, the application will call the Web service to synchronize the changed data after the client is offline to the server.

The biggest difference between a service-oriented method and a data-oriented method is that business logic is placed on the server side.
Therefore, the service-oriented method does not need to deploy a local relational database on the client, so it can implement independent version control and deployment. In case of data conflict, the maximum control flexibility can be obtained, it also means that developers need to write code for data coordination. the service-oriented method is mainly used for the development of enterprise-level N-layer applications.

After the system executes the offline function: the process is as follows:
(1) The application will save the dataset in memory to the local hard disk. The saved files are based on the XML document format, and the data content will be in the status before going offline.
(2) The Program sets a variable indicating whether to be offline as false. When data changes in the future, the application saves the changed data to dataset, and the changed data row is marked as changed.
(3) Update the application interface to reflect the offline status.

If you exit the application in offline mode, the system saves the changed dataset to a separate XML file on the disk. after the client user returns to the online status, the changed data is sent to the Data Web Service. The web service processes each change and sends the result to the client ..

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.