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:

  1. perform on races displayed in client update status.
  2. 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:

  1. simply delete old race records on client , new records
  2. perform 2 separate operations, first updates old records, , second new pending / inprogress races
  3. 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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -