1 / 17

Data Synchronization

Data Synchronization. Dani Beaubien dbeaubien@myballteam.ca. Session Overview. Who am I and how am I different that a hole in the ground, “Data Synchronization” - What is it? Be Prepared, Session Article, Communication between client and server, Q & A. Who am I?.

bazyli
Download Presentation

Data Synchronization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Synchronization Dani Beaubien dbeaubien@myballteam.ca

  2. Session Overview • Who am I and how am I different that a hole in the ground, • “Data Synchronization” - What is it? • Be Prepared, • Session Article, • Communication between client and server, • Q & A

  3. Who am I? • Worked with 4D for over 15 years, • Data Synchronization solution in use for 4 years with hundreds of users, • Worked with commercial 4D vertical applications for the last 8 years. Reliability and low support requirements are very important, • Developed 4D Web solutions,(e.g. http://portal.myballteam.ca) • Developed solutions that utilized XML, HTTP, HTML, SOAP Client, SOAP Server, HL7, TCP/IP, Unix, Apache, PDF, RTF, • User-Centrically focused, • Published in 4D Journals.

  4. “Synchronization” Defined v.intr. 1. To occur at the same time; be simultaneous. 2. To operate in unison. v.tr. 1. a To cause to occur or operate with exact coincidence in time or rate: We synchronized our watches. b To cause to occur or operate at the same time as something else: They synchronized their trip with the annual tulip festival. 2. To arrange (historical events) in a synchronism so as to indicate parallel occurrence. 3. To cause (soundtrack and action) to match exactly in a film.

  5. What is it • Better term - “Data Replication”, • Data mirroring for free, • Data recovery for free, • Scalability for free, • Near-Real-Time, • Record level data replication, • Scalable, (yes, I know that this has already been mentioned) • Fault tolerant for free.

  6. What it is not • “Distributed Database”, • Field level data replication, • Trivial to implement - requires planning and awareness of users usage patterns, • Something that users will appreciate.

  7. Be Prepared • Be clear on the pros and cons that data synchronization has to offer, • Go into this with your eyes open, • Understanding of client/server communications and network protocols, • Have “buy in” from the decision makers.

  8. Session Article The article covers the database changes necessary to track changes and know what which changes should be sent to the “other side”. This session covers the communication between the client and the server.

  9. Client/Server Communication • XML passed over TCP/IP, • Wrote my own SAX parser (using v6.7 of 4D), 2003+ has it’s own XML parser, • Classic request/response model. Client is the requestor, • Most “state” information is retained by the client (easier to implement), • Server does all authentication.

  10. CLIENT Open a Connection Request a seed Turn a seed into a session ID Send Login Message Get Block Sizes SERVER Open a Connection Return a seed Send Login Response Send Block Sizes The “Login”

  11. Login XML Message <LoginRequest sessionID="adfsdf"> <UserID>someUserID</UserID> <AppName>YourAppNameHere</AppName> <AppVersions>v1.3</AppVersions> <AppSN>234-543-5345-xxs</AppSN> <ClientGUID>x093jfgdfkjgg</ClientGUID> <curDTS>20050819230503</curDTS> <sessionID>fukjlkjdfg8</sessionID> </LoginRequest>

  12. Possible Errors to Login Message • -1: session ID doesn’t match • 0: all is okay • 10: user doesn't exist on server • 20: different product (via name) • 21: different version of product • 22: SN doesn't match • 23: server's GUID is same as client (very bad) • 30: date and time on client is too far from server

  13. CLIENT Ask for Delete Count Loop: Get blocks of Deletes QUERY: Figure out how many deletes need to be sent to the server. Loop: Send blocks of deletes SERVER Return Delete Count Loop: Send blocks of Deletes Receive blocks of deletes Exchanging “Deletes”

  14. CLIENT Loop: Send dictionary block Get dictionary block Loop: Send record block SERVER Get dictionary block Examine for those that we want. Send dictionary block Get record block Exchanging “Client Changes”

  15. “Dictionary Block” • “Send” includes for each item: • Table No • Record GUID • Record Number • Record DTS • “Response” includes for each item: • Table No • Record GUID • Record Number (from client)

  16. CLIENT Ask for change count Loop: Ask for dictionary block Examine for those that we want. Send dictionary block Loop: Get record block SERVER Send change count Send dictionary block Examine for those that we want. Get dictionary block Send record block Exchanging “Server Changes”

  17. DemonstrationQ & A Dani Beaubien dbeaubien@myballteam.ca

More Related