Subject: Cache.ndk
My (limited) understanding is that the Cache.ndk keeps a journal of the read and unread operations you carry out on a replica of a database.
When you access another replica of the same database, this journal gets “played back” to ensure that the second replica has the same read/unread operations synchronised (independent of any replication).
For example assume I have a mail file with a server and local replicas.
I replicate with the server, and now have 4 unread documents in both my local mail file and the server.
I read 3 of the documents, and mark a previously read document as unread (to remind me to do something with it). My Cache.ndk will contain a journal of those transactions:
Mailfile.nsf
Read doc1
Read doc2
Read doc3
Unread doc4
If I open the server based replica (WITHOUT REPLICATION) then the journal gets played back so that the doc1,2&3 are marked as read on the server, and doc4 as unread.
If I then replicate with the server, then my unread marks become synchronised through replication anyway (in theory)
A couple of caveats to the journal, it can only store a finite number of read / unread operations so for example a document you’ve read 3 months ago won’t show on the journal anymore. It also works in tandem with replication so you may get the journal conflicting with what replication has told it with undesirable results (i.e. the Journal may mark as read a document which has been set as unread via a backend agent when it gets played back after replication).
As to testing / simulating I’m not sure why you would need to do this, as it is an internal feature of Notes which just helps synchronise unread marks between replicas. If it doesn’t work as desired it is something for Iris to fix, not yourselves!
Essentially testing would involve starting with a clean Cache.ndk, then accessing multiple replicas using the same client and making sure that the read/unread operations get applied to each replica (without the need for replication).
You may want to throw in some document updates in to the bag to see what effect it has i.e.
User A reads doc 1 on Replica i
User B updates doc 1 on Replica ii (making it unread for User B)
User A opens Replica ii and sees whether doc 1 is read or unread (i.e. does journal take precedence over a new unread mark).
HTH - Rufus.