Comments (2)
Further thoughts:
- We should store
updated_on_server_at
during thePOST
request, so that we can compute the diff of records to send to each device during the sync. - Sync all records first time. First time syncing should be indicated by absence of
updated_on_server_at
or a more specific field in the request. - We should separate the notions of request and response timestamps from
updated_at
timestamps of the records. To compute the diff, we should only ever use timestamps of records, not request/response timestamps. - At the end of the GET request, we should compute the
latest_record_timestamp
, and send that to the device with the response. The device can send this value with the next request to receive the next batch of records. This makes the pulls batch-able as a stream of independent requests, without needing to keep a track of when the sync 'ends'. Do not uselast_sync_at
for this reason.
Things the device/front-end should do:
- Devices should store
latest_record_updated_at
per API endpoint. - Devices should send a value denoting the number of records, or
batch_size
they want. This can change per request. - Devices should
push
before theypull
Things we're not doing right now:
- If we want to send back only the diff of changed records per user, we should store
last_updated_by_user_id
- If we use
last_sync_at
, it should be set at the beginning of theGET
request, not the end. - We could include a margin of error in the time range we use to retrieve records to sync, to account for some race conditions or time differences across devices/servers.
Patterns for office mobile syncing architecture: https://www.dre.vanderbilt.edu/~schmidt/PDF/PatternPaperv11.pdf
from simple-android.
@timcheadle: @govindkrjoshi and I are in agreement about the above. Thoughts?
from simple-android.
Related Issues (20)
- A better way to add feature flags HOT 6
- `ProgressMaterialButton` HOT 16
- Migrating to Java Optional
- Use Dagger `Qualifier` instead of `Named` HOT 5
- Instruction to setup up JDK 1.8 installation on Windows Machines (Readme) HOT 2
- Suggestion[Update Git clone command) Readme HOT 4
- Improve the navigation framework HOT 4
- Proposal for automatic performance reporting of SQL queries HOT 5
- Proposal for Fragment Results API HOT 12
- Setting up a regression test suite for meeting performance goals HOT 4
- Dependency Dashboard
- Reset PIN HOT 1
- Action Required: Fix Renovate Configuration
- Reporting a vulnerability HOT 2
- Hide "Record every patient…" text on home when a snackbar is visible HOT 1
- Switch to using App Bundle format for APK to reduce install file size HOT 3
- Gzip request bodies of network calls in the app HOT 4
- If the process restarts while a registration is happening, the app crashes HOT 1
- "Every patient" span of the message on the patients tab is missing on Lollipop devices HOT 1
- Build a custom view to enable fast entry of blood pressures HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-android.