incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Cohnen <sebastiancoh...@googlemail.com>
Subject Re: expected behaviour of changes feed
Date Sat, 07 Aug 2010 16:52:10 GMT
hey cliff,

you need to be aware, that "revisions" are not meant to be used for document versioning. _rev
should be called _mvcc_token (or something like that) as couchdb only uses this information
for concurrency control (conflict detection and resolution). you should *never* rely on old,
non-conflicting versions to be around, as couch does not make any guarantees about their availability.

for that reason, I believe that this approach is not working if you seek to do a full audit
of every change to a database. e.g. when you need to compact your database, you might "loose
revision" information.


best

Sebastian

On 07.08.2010, at 16:56, Cliff Williams wrote:

> All,
> 
> Good afternoon.
> 
> using this url http://10.0.0.10:5984/test/_changes?since=14966&all_docs=true
> 
> I get the following results
> 
> {"results":[
> {"seq":14971,"id":"ab53d85b92247bcbf251ef9abed4d998","changes":[{"rev":"2-b9cfa00cc907767d6bfdeca7dee5008f"}]},
> {"seq":14973,"id":"ab53d85b92247bcbf251ef9abed4d512","changes":[{"rev":"3-ec350b40276b7c16c09ef485dd8f14aa"}]},
> {"seq":14981,"id":"ab53d85b92247bcbf251ef9abed4a63a","changes":[{"rev":"2-fe0cb06e7046e9d41d326b3e8c30ed0c"}]},
> {"seq":14982,"id":"_design/test","changes":[{"rev":"8-5a565b32bca9b42479543441f23a2e61"}]},
> {"seq":14983,"id":"ab53d85b92247bcbf251ef9abed4b4d8","changes":[{"rev":"2-ed899403c21b6cca22f7e68f05d92b0c"}]},
> {"seq":14984,"id":"ab53d85b92247bcbf251ef9abed47f2f","changes":[{"rev":"2-30d5cf6764f2e6c1795d65f272817238"}]},
> {"seq":15006,"id":"ab53d85b92247bcbf251ef9abed4e544","changes":[{"rev":"10-e6856aac928ff1e2e019b556de8f1760"}]},
> {"seq":15007,"id":"ab53d85b92247bcbf251ef9abed49e50","changes":[{"rev":"19-d7629eac5a5bd2133a19178fdc9277e6"}]}
> ],
> "last_seq":15007}
> 
> now if I make an amendment to the document at sequence number 15006 and using the same
URL I get the following results.
> 
> {"results":[
> {"seq":14971,"id":"ab53d85b92247bcbf251ef9abed4d998","changes":[{"rev":"2-b9cfa00cc907767d6bfdeca7dee5008f"}]},
> {"seq":14973,"id":"ab53d85b92247bcbf251ef9abed4d512","changes":[{"rev":"3-ec350b40276b7c16c09ef485dd8f14aa"}]},
> {"seq":14981,"id":"ab53d85b92247bcbf251ef9abed4a63a","changes":[{"rev":"2-fe0cb06e7046e9d41d326b3e8c30ed0c"}]},
> {"seq":14982,"id":"_design/test","changes":[{"rev":"8-5a565b32bca9b42479543441f23a2e61"}]},
> {"seq":14983,"id":"ab53d85b92247bcbf251ef9abed4b4d8","changes":[{"rev":"2-ed899403c21b6cca22f7e68f05d92b0c"}]},
> {"seq":14984,"id":"ab53d85b92247bcbf251ef9abed47f2f","changes":[{"rev":"2-30d5cf6764f2e6c1795d65f272817238"}]},
> {"seq":15007,"id":"ab53d85b92247bcbf251ef9abed49e50","changes":[{"rev":"19-d7629eac5a5bd2133a19178fdc9277e6"}]},
> {"seq":15008,"id":"ab53d85b92247bcbf251ef9abed4e544","changes":[{"rev":"11-e01ef09eef56397e345f598fd2069f22"}]}
> ],
> "last_seq":15008}
> 
> 
> I think that it is fairly straight forward to ascertain that we are looking at latest
revision sequences.
> 
> Is there a way to see all sequence numbers?? I am of course aware of the continuous feed
but do not wish to use it.
> My use case is for a pharma regulated clinical trials database where i need a total audit
of every single change made to the database.
> 
> best regards
> 
> Cliff


Mime
View raw message