api - Rest philosophy for updating and getting records -
in app i'm displaying race objects have 3 states: pending, inprogress , completed. want display races pending or inprogress, not ones completed. this, want create restful api getting these resources server, i'm not sure best (i.e. restful) approach be.
the issue when opens or refreshes app, need 2 things:
- perform on races displayed in client update status.
- get of new pending or inprogress races have been created since client last updated
i've come few different solutions, though don't know which, if any, best:
- simply delete old race records on client , new records
- perform 2 separate operations, first updates old records, , second new pending / inprogress races
- perform single operation specify created date of last client record, , records newer.
to me, seems pretty common scenario haven't been able find specific answer type of problem. i'd see thinks :)
thanks in advance help!
simply delete old race records on client , new records
this easiest solution. shouldn't if need smooth update on client (for games, data visualization, etc.).
perform 2 separate operations (...) / perform single operation specify created date of last client record, , records newer.
i single operation. better update timestamp (timestamp operations costly, , several operations happen @ same time), use sequence number. this way couchdb handles "changes". moreover, see in documentation, solution can upgraded asynchronous notifications (if need so).
Comments
Post a Comment