incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Replicating partial databases, and validation
Date Sun, 15 Feb 2009 19:10:58 GMT
I'm interested in using CouchDB in a peer-to-peer fashion to propagate  
content between nodes that don't necessarily trust each other. The  
available documentation sort of runs out before getting to many of the  
aspects I'm interested in [I am eagerly awaiting more chapters of the  
book!] but from reading the list archives and people's blog posts, it  
sounds like it should be do-able. I'm just not clear on the details.

• Is it possible to pull part of a database? For example, I might to  
pull only nodes whose names start with a particular prefix, or whose  
content contains a particular key/value pair.

• Can the server validate the content of documents being pulled from  
another DB? I may want to disallow updates that modify an "author:"  
property, or whose "date:" property isn't in a valid format. Or I  
might want to check a digital signature[1] on each incoming entry.

• Likewise, can the server validate docs being posted directly,  
outside of replication?

Some sort of generic validator hook that got called on all docs being  
added to the db, and could give thumbs up or down, would suffice. One  
of jchris's blog posts[2] implies this exists, but he's deciphering  
its functionality from a unit test, and as a total newbie I couldn't  
follow the details of what this hook is capable of.


[1] Speaking of digital signatures, above — how would I perform public- 
key crypto operations from within a JS handler running in CouchDB?  
Would this require writing glue libraries for SpiderMonkey, to call  
into e.g. OpenSSL?
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message