couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Carey" <paul.p.ca...@gmail.com>
Subject Re: partial/diff updates?
Date Sat, 13 Dec 2008 08:23:26 GMT
> If I could do partial updates, I would store all the user_ids inside a
> field of a group doc such as:
>
> "memberships": [user_id1, user_id2, etc]
>
> I could do this right now, but what if I want to update or delete a
> membership? If a group has a million users

This model suggests that you would effectively be allowing a million
users to write to a single document, which is probably unwise if
contention-free writes are a goal of your application.

A better approach might be to store the group membership in each user
doc. A view could emit the group_id key against the user doc - this
would provide roughly the same data as a group doc containing an array
of user ids.

Paul

Mime
View raw message