[jdev] Roster caching

Dave Cridland dave at cridland.net
Thu May 4 06:46:00 CDT 2006


On Thu May 04 10:40:17 2006, Vinod Panicker wrote:
> On 5/4/06, Tijl Houtbeckers <thoutbeckers at splendo.com> wrote:
>> http://www.jabber.org/jeps/jep-0150.html
> 
> Thanks!  Seems like a perfect match.
> 
> 
Hmmm... Well...

The trouble is, you're getting all or nothing - if you add a group to 
a single contact out of 150, then you're still getting everything. 
Added a single new contact? Get everything. Deleted one? Get 
everything.

Remember, the typical case is going to be that nothing has changed. 
JEP-150 handles this case reasonably well. The next most common 
occurance will be a single change or addition, but JEP-150 doesn't 
handle this at all.

FWIW, ACAP and IMAP+CONDSTORE both have models we can copy here:

1) The roster has a magical strictly increasing number. I'll call 
this the roster modseq. Conceptually it's like a timestamp, except 
it's like a timestamp would be if timestamps worked. (ACAP uses 
timestamps adjusted to work, IMAP uses magic opaque 64-bit numbers. 
Same thing, really.)

2) With any change, deletion, or addition, this value is increased, 
and the roster entries added or changed get assigned the new value. 
These values need to be transmitted to the client as part of the 
roster entry.

3) Operations need to be provided for:
a) obtaining changes since a modseq
b) obtaining a list of deletions (Deletion tracking can be hard, and 
tends toward infinite data retention, so this may error)
c) obtaining a list of entries without any detail. (This would  be 
used for client-side deletion detection. We'd be sending just the 
<item jid="foo at example.com"/> and no groups, names, etc.)

Note that the server doesn't have to store the state of all clients, 
or anything drastic, it's just one extra integer per roster entry, 
plus whatever deleted roster entries it wants to keep.

Clients get to sync cheaply as a result. (Really clever handling can 
even reduce the resynch round-trips to zero, as IMAP CONDSTORE can.)

Dave.
-- 
           You see things; and you say "Why?"
   But I dream things that never were; and I say "Why not?"
    - George Bernard Shaw



More information about the JDev mailing list