James M Snell wrote:
John Panzer wrote:
[snip]
The challenge is knowing how long to keep the x:deleted-entry things
around in the feed.
Perhaps it's sufficient in many cases for the feed to indicate to
consumers how long it keeps deleted-entry items around. Then a consumer
who checks back, finds that they may have missed a tombstone, has the
option of doing a complete sync by paging back through the feed history.
One idea I had was that a feed would only contain deleted-entry elements
for entries that fall within the same atom:updated date range as the
atom:entry's in the feed. That is, if the deleted entry *would* have
appeared in a particular feed page based on it's app:edited or
atom:updated value, then there would be a deleted-entry element. The
downside of this would be that deleted-entry elements would be spread
out across multiple feed pages. I'm not sure if that's a really bad
thing or not.
- James
This problem isn't confined to just deletes; we also need a way to
signal updates. This problem is also related to Brian Smith's post "How
to implement the "Give me all the new & updated entries" use case" on
7/13. It's a more general issue.
The general problem is how to keeping two databases in sync via a feed.
The normal way to do it is with something akin to a transaction log. A
log has a timestamp, and then it has record of the change that happened,
which is always an insert, an update, or a delete.
An Atom feed can look like a transaction log if we just add a flag to
indicate an update or a delete. If the flag is not present, it's an
insert. The timestamp is the <updated> value. The flag could look like this:
<atom:action>delete</atom:action>
or possibly
<atom:delete/> or <atom:updated>
I like the "action" tag because it's more obvious.
If we combine this with a mechanism to get every entry since a certain
timestamp (per Brian Smith's request), then we have a reliable way to
support simple transactions, and Atom can be a general mechanism for
data distribution. I suggest adding a "since" parameter to the feed's URL:
http://mydomain/myfeed?since=2007-08-09T14:00:00