Last active
December 16, 2015 22:59
-
-
Save metavida/5510794 to your computer and use it in GitHub Desktop.
Sequence diagrams describing possible data synchronization methods. You can visualize these using http://www.websequencediagrams.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Syncronization Sequence (Phase 1) | |
User->App: Open & Login | |
App->Server: GET ToDos | |
Server->App: 200 OK\n{title:eat breakfast, updated:02:00} | |
Web->Server: Update ToDo #1 via web at 02:30\n{title:eat lunch} | |
User->App: Update ToDo #1 in app at 03:00 | |
App->Server: PUT update ToDo #1\n{title:eat dinner} | |
note over Server | |
The web changes are overwritten | |
end note | |
Server->App: 200 OK\n{title:eat dinner updated:03:00} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Syncronization Sequence (Phase 2) | |
User->App: Open & Login | |
App->Server: GET ToDos | |
Server->App: 200 OK\n{title:eat breakfast, updated:02:00} | |
Web->Server: Update ToDo #1 via web at 02:30\n{title:eat lunch} | |
User->App: Update ToDo #1 in app at 03:00 | |
note over App | |
Send the updated value last received from the Server, *not* the current time | |
end note | |
App->Server: PUT update ToDo #1\n{title:eat dinner, updated:02:00} | |
Server->App: Reject PUT with 40X status\n{title:eat lunch, updated:02:30} | |
App->User: Ask user about overwriting changes\n(use "eat lunch" or "eat dinner"?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Syncronization Sequence (Phase 2) continued... | |
# When a change is rejected | |
# This first line is only here to order the columns correctly | |
User-->>App: | |
Server->App: Reject PUT with 40X status\n{title:eat lunch, updated:02:30} | |
App->User: Ask user about overwriting changes\n(use "eat lunch" or "eat dinner"?) | |
alt User chooses the Server version | |
User->App: Use "eat lunch" at 3:30 | |
note over App: Update the local updated value to 02:30 and discard the local "eat dinner" title | |
else User chooses the App version | |
User->App: Use "eat dinner" at 3:30 | |
note over App | |
Send the updated value last received from the Server, *not* the current time | |
end note | |
App->Server: PUT update ToDo #1\n{title:eat dinner, updated:02:30} | |
Server->App: 200 OK\n{title:eat dinner, updated:03:30} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment