incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Bardubitzki <step...@bardubitzki.com>
Subject Re: Tracking doc access
Date Fri, 15 Mar 2013 02:23:39 GMT
Hi Jim,

thanks for your feedback, makes sense to me.

Stephan

On 13-03-14 07:13 PM, Jim Klo wrote:
> I think you'd be better off tracking access by inserting an immutable 
> document with a new timestamp and doc._id of the accessed document.
>
> You could then create a view that 'joined' the timestamp doc with real 
> doc, by emiting timestamp as key and { _id: accessed_doc._id } as the 
> value then requesting with_docs=true if I remember correctly…
>
> Updating doc to append a timestamp would be inherently slow if you 
> have a high volume of repeat access and cause your views to 
> consistently have to update…
>
> just my 2¢
>
> - Jim
>
> *
> *
> *
> *Jim Klo*
> Senior Software Engineer
> Center for Software Engineering
> SRI International
> *
> *
> *
> *
> *
> *
> t.@nsomnac
> *
> *
> *
>
> On Mar 14, 2013, at 5:56 PM, Stephan Bardubitzki 
> <stephan@bardubitzki.com <mailto:stephan@bardubitzki.com>>
>  wrote:
>
>> Hi there,
>>
>> I have a task where I need to track how often a doc is accessed. The 
>> two possible ways I can think of are:
>>
>> 1. add an array to the doc and add the timestamp when it is accessed
>> 2. create a new document and add the doc._id and the timestamp
>>
>> Which one would you prefer? Or is there a better solution?
>>
>> Thanks,
>> Stephan
>>
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message