Created
March 31, 2016 07:01
-
-
Save fairchild/1e2b06916e51261f52db494373b68c59 to your computer and use it in GitHub Desktop.
sync flow for data created on mobile first
This file contains hidden or 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
title Create Data Mobile First | |
participant mobile as m | |
participant server as s | |
participant database as db | |
m -> m: create item {uuid} | |
m -> s: POST item {uuid} | |
s -> db: begin transaction | |
s -> db: SELECT id, uuid WHERE uuid={uuid} from write_log | |
alt if not found | |
db --> s: id | |
s -> db: insert item_type, id, uuid | |
db --> s: ok, commit transaction | |
s --> m: 201, id, uuid | |
end | |
alt if found | |
db --> s: found uuid | |
s --> m: 200, id, uuid, etc... | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment