Carson
Carson

Reputation: 17761

Handling updates to data In your API

Assume I have a feed of data ordered by an "ordering" field. This data is fed to a consumer via API, and the consumer caches it locally.

Now, let's say I correct a typo in an entry that has already been cached by the consumer, but need the consumer to pick it up. The content I'm feeding them is ordered by "ordering", and they won't be re-requesting older data.

How can consumers pick up the changes? This data isn't necessarily date-based, and "ordering" does not necessarily correspond with the value of a primary key.

Upvotes: 2

Views: 60

Answers (2)

harschware
harschware

Reputation: 13404

The Observer Pattern.

Upvotes: 0

Pace
Pace

Reputation: 43817

Can you insert a special type of record which is a "change" record and has a new timestamp. Then they'll pick it up, know it's not an actual record and make the needed change.

Upvotes: 2

Related Questions