YapDatabase icon indicating copy to clipboard operation
YapDatabase copied to clipboard

CloudKit rate limiting

Open zsau opened this issue 8 years ago • 1 comments

Unless I'm missing something, it's not possible to limit how frequently the CloudKit extension uploads changes to the server, short of doing everything manually. Is rate-limiting (possibly per-collection) a feature that would be considered, if I submitted a pull request?

Motivation: my app updates certain collections very often, but they are not that crucial to upload to CloudKit in a timely manner (mostly UI state stuff). I already limit how often the values are persisted to the database, but for the sake of updating the UI I still want to save these values to the local DB pretty frequently, more so than makes sense for CloudKit syncing.

zsau avatar Aug 14 '16 07:08 zsau

Correct, there isn't a baked-in solution for this. That is, there isn't anything simple like an existing rateLimit property.

You could implement something like exponential back-off once you start receiving rate-limited errors from the server. This could be done in a simplistic fashion my suspending/resuming the CloudKit extension instance.

Is rate-limiting (possibly per-collection) a feature that would be considered, if I submitted a pull request?

Built-in rate limiting is definitely something the project would be interested in !

robbiehanson avatar Aug 15 '16 22:08 robbiehanson