Services/Sync/Server/SyncChangesets: Difference between revisions

(Created page with "=Sync Changesets= In an effort to minimize reads to the db, we should cache the newest changes that are written to the system. Since most devices sync within a fairly short windo...")
 
 
Line 7: Line 7:


==Read==
==Read==
*Check info/collections to make sure there are changes post the requested time
#Check info/collections to make sure there are changes post the requested time
*If request is for period > changeset window (2 days?) go straight to db
#If request is for period > changeset window (2 days?) go straight to db
*Grab <user>:<collection>:changeset; if doesn't exist, fall back to db
#Grab <user>:<collection>:changeset; if doesn't exist, fall back to db
*Loop through changesets (<user>:<collection>:<timestamp>), grabbing them out of memcache. Merge and return.
#Loop through changesets (<user>:<collection>:<timestamp>), grabbing them out of memcache. Merge and return.
*If some are missing or server suspects an error, fallback to db
#If some are missing or server suspects an error, fallback to db


==Write==
==Write==
canmove, Confirmed users
1,173

edits