incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Jan van Meerveld <haa...@gmail.com>
Subject Re: Help needed: is couchDB a good fit for my app?
Date Fri, 22 Apr 2011 02:59:11 GMT
Hi Clement,

I can think of two other options.
They are not perfect but easier to implement:

1. ------
You can use a "Public Docs" database and a "User database" (one User
database per user) like Ryan suggests
When someone tags or un-tags a document the application does two writes:
- a write to the Public Docs database to update a counter
{"type":"tagcounter", "docid":"mydoc", "tag":"mytag", "count":count+1}
- a write to the User database to register the private tag

That way you can easily get stats from the Public Docs while the user tags
cannot be read by anyone except the user.
Of course a problem could arise when the writing to one of the two databases
fails.


2. ------
You can give every user a random code like
{
  "type":"user",
  "user":"John Smith",
  "randomCode":"aslieghahsdfhlajsreij"
}

and then the user creates document tags (in the same database) like:
{
  "type":"document tag",
  "userCode":"aslieghahsdfhlajsreij",
  "documentId":"mydoc",
  "tag":"mytag"
}

This is really easy implementing and might be safe enough for your case.
And you might be able to scramble the randomCode with the user password so
it would become more difficult to find out which code belongs to which
user.

Kind regards,
Hendrik Jan




On 21 April 2011 18:39, Ryan Ramage <ryan.ramage@gmail.com> wrote:

> You might want some architecture like this:
>
>                  [] Public Docs db           |
>                                                      |  <----- hosted
> [] User 1db    [] User 2 db  []....         |
> ------------------------------------------------------
>
> [] User1 phone db   [] User 2 Phonedb   []....
>
>
>
> My ascii art is not very good :)
>
> Then have replication between phone and user db. Then have replication
> from Userdb to public docs db with a filter to take out private
> tags...
>
>
> Does that work?
>
> Ryan
>
>
>
>
>
>
>
> 2011/4/20 Clément Vollet <cvollet@gmail.com>:
> > Hello everybody,
> >
> > First of all, I want to say that I'm quite impressed with couchDB so far
> > (I didn't know anaything about it two days ago...).
> >
> > Second, I'd really want to use it for my app (I stumbled upon couchdb
> > searching for a database that fits my requirements in fact). I manage to
> > cross a few items off my list, but I'm still not sure couchDB is a good
> > fit, and my boss wants an answer by tomorrow.
> >
> > So, to summarize what I want to do (it's really simple in fact): I'd
> > want to be able to have a list of public documents, have a list of tags
> > definition (name, default value, possible values...), and then users can
> > *privately* tag those documents. So, the items and the tag definitions
> > are public, the tag values are private. And finally, I'd like to be able
> > to have stats on those values, like XX% of the users used the same value
> > for this document and this tag.
> >
> > And that's it. It would be in a phone app, and I'd really like to use
> > replication to have a client cache for values and an offline mode. There
> > would of course also be a central server for bootstrap, updates,
> > reliability, ...
> >
> > So, CouchDB seems like a really good fit, but I'm stuck on the privacy
> > thing. What I came with so far, was to have separate documents for
> > items, tags, and tag values, but how can I make sure only the user who
> > wrote the value can read it without per document authorization (I
> > already read the wiki page about that, but none of the solution seems
> > ideal)?
> >
> > Best regards,
> >
> > Clément
> >
>

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