Munchable's app reads a product label and tells you whether that product suits your gut. The part of it that improves most often is not the code, it is the ingredient data: new words, new spellings, new names for the same thing. Shipping that through the app stores would mean a release per data fix, so instead the app downloads a snapshot of it and keeps a copy on the device.
That means I need an answer to a question that comes up more often than you would think: has this phone's copy gone stale?
The answer is one number.
max(updated_at) over every active row of both tables, as an epoch-ms decimal string. '0' when empty. One number for the whole snapshot.
Enter fullscreen mode
Exit fullscreen mode
That string is the version. It is also the ETag . It is also the value of an x-taxonomy-version response header on other endpoints, and the key the server caches under.…