couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Landolt <>
Subject Re: playing with tags
Date Thu, 12 Feb 2009 16:31:13 GMT
On Thu, Feb 12, 2009 at 11:16 AM, Kerr Rainey <> wrote:

> 2009/2/12 Dean Landolt <>:
> > Perhaps in this scenario, but take a feed reader, for instance. When a
> user
> > is tagging feeds, it is subject to change at a much different rate than
> the
> > otherwise static content. Even in a single user scenario, once
> replication
> > is introduced (say, to a local instance of the app), it's easy to imagine
> a
> > situation where things get messy. Then imagine read/unread metadata, and
> all
> > the others types of user data associated with this otherwise static
> content.
> Obviously you need to fit the solution to the problem.  Storing meta
> data in a doc is not inherently a problem.  Storing *any* data that
> has high contention on a single document is a problem, but that's just
> basic CouchDB in the same way that you wouldn't store the comments on
> a single blog post doc.  If your meta data is highly contended then
> you need to find another way round it.  But all this is a non sequitur
> from the problem of getting AND semantics for keys in view lookups.

Perhaps this does belong in a different thread, but the example just
reminded me of the general design question -- AND semantics and view
intersections by value are a pretty big part of it.

Take read/unread state. Obviously you don't want to store this in the doc --
each read/unread event is separate from the doc. So you could keep separate
docs like this:

   "_id": "4b3d17d0269e0fa23072abec8859f447",
   "_rev": "1211529288",
   "at": "2009-02-02T08:07:56Z",
   "class": "state",
   "entry": "",
   "read": false

...or some such -- that's just an implementation detail. You can reduce
these state events down into one value (also taking into consideration, for
instance, when an update field on the doc is newer than the latest read

If you just want to get all unread feeds, AND semantics would be pretty damn
helpful (yes, I know you could do a multi-key get and filter at the client).
But when you want to know which feeds are unread for a view it's unavailable
to you (that's what I meant by map/reduce/map). Paul's ideas about values
indexes are one possible way to get around this. I was just wondering
whether there was another approach I'm missing.

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