Server and client database synchronization ideas

Source: Internet
Author: User

Client: (Abort)

ID Name syncstatus lastupdatetime syncerror

1 xxxx 0 (synchronized) 2014-10-13 null

2 XXXX 1 (locally added). Null

3 xxxx 2 (Local modification): 1

4 xxxx 3 (local delete): Null

5 xxxx 4 (synchronization error). Null

Service-side (enabled)

ID Name LastUpdateTime

1 xxxx 2014-10-13 13:50:44

2 xxxx.

3 xxxx.

4 xxxx.

Server Synchronization operations:

LastUpdateTime > Local record maximum lastupdatetime per entry

LastUpdateTime all records less than or equal to the current time, download to add/modify

Synchronize the local to the server:

Gets an array of syncstatus records that are not 0 sent to the server

Server processing:

Syncstatus = 1: Check if the server has a record, none: New,

Yes:

If Syncerror is not 1:false

If Syncerror is 1: Modify

Syncstatus = 2: Check if the server has a record: modify:

No:

If Syncerror is not 1:false

If Syncerror is 1: Modify

syncstatus = 3: Check if the server has a record: Delete none: True

The server returns the processing array:

[

{ID: "111", Syncerror: "0 (Synchronized), 1: (Sync error)" MSG: "Error Report"},

{ID: "Syncerror", "0 (synchronized), 1: (Sync error)" MSG: "Error Report"}

]

The client receives the processing report:

Change the ID under and syncerror=0 the record under field Syncstatus to 0

Server and client database synchronization ideas

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.