Consider a facebook-like application and following sequence of actions:
- Application submits post-content to the server
- Server associates a UUID to that post-content and inserts the post in a KV-store against that key. Server also successfully
- Server is unable to send response OR App is unable to get a response back because of network failure between the Server and the App
- App retries the upload of the post. Server repeats steps 1-2. This time succeeds to enter an entry into the KV-store
At this point, the KV-store has duplicate entries for the post and the user will see 2 entries for the post.
How do Facebook-like apps address this problem.
I believe the only solution to this problem is to have idempotency of requests and that will only be possible if the App re-uses the same ID when re-submitting the same request.