I have a RESTful API with corresponding clients.
If a client request fetches a set of resources (Events) based on a filter, say events taking place between 2015-04-13 - 2015-04-19. If an event which has previously been synced to the client changes time on the server so that it will be outside of the above time range it, the next request will not include the updated event and the client will not know about the change until it makes a request which includes the updated time.
The solutions I'm thinking of are
- Adding simplistic version management by creating a new events with the updated time which refers to the original event whenever an event is updated. When a request is made the server would have to return the latest version of all the events within the time range.
- Adding a new resource (say EventUpdate) which only tracks time changes of an event leaving sort of a "gravestone" where the Event used to be. Whenever a request is made EventUpdates would have to be checked to see if there previously was an event in the requested time range, if so, these Events should also be included in the response.
Right now I'm leaning towards solution 2. since it seems less overkill for what I need right now.
Is there any standard way of solving this kind of synchronization problem?