-
Notifications
You must be signed in to change notification settings - Fork 297
Sync API
#Proposal
An API like the current _replicator and _replicate solutions, but more data centric. So instead of being at the server level, there'd be a database level API like:
So if you have one for https://sync.example.com/foobar for channels myuser-inbox and broadcast, you can schedule it to be more agressive than another sync from the same remote.
We should automatically avoid push replicating twice to the same remote.
Returns list of all sync sessions this database has, ordered by remote.
It would be nice if this is idempotent: eg the docid is derived from the sync options somehow. I think we do that already. - CA
Create a new sync session. Redirects to the sync session url. Here are some of the options in the JSON object:
push : true,
pull : true
channels:[...],
remote:
URL
Auth
Etc
Other options
UI triggered (refresh sync on app foreground etc)
Schedule
Network
Attachments defer
Location header: /db/_sync/sync-id
- Info about remote source and progress (status not stored in database, config stored in database)
- Session info
- Last successful request time
- Last error request time, etc