Thank you for providing these information, I really need to learn more documents.
________________________________ From: Stefan Klein <[email protected]> Sent: Thursday, April 26, 2018 8:05:13 PM To: [email protected] Subject: Re: Some questions about couchdb Hi Jinmin, 2018-04-26 2:11 GMT+02:00 明 淨 <[email protected]>: > 1. If I store the info of a person as a document in couchdb, will update of a > few words in his/her self introduction cause the whole document to be > rewrite? also, I have to submit the whole document to make this a few words > update? Shall couchdb support field unit update in the future? You could use an update handler for this case: http://docs.couchdb.org/en/2.1.1/api/ddoc/render.html#db-design-design-doc-update-update-name If it makes sense depends on the actual problem you're trying to solve. > 2. By default, a user of a database in couchdb can update all the documents > in the database, but usually in the real world, every document has it's > owner, and shouldn't be updated by users other than the owner. Is there any > mechanism in couchdb to support document unit authorization? In addition to the one database per user approach, there also is the validate_doc_update function: http://docs.couchdb.org/en/2.1.1/ddocs/ddocs.html#vdufun Again, it depends on the actual problem you're trying to solve. If for example in your application everybody, maybe even anonymous users, may read every document but only members of a specific role may create and only "the owner" (how ever you determine it) may update a document using validate_doc_update might be the way to go. > 3. As replication is the basis of data sync across cluster nodes, so will > couchdb support field unit update in cluster data sync, not just document > unit? Replication replicates whole documents, attachments are handled differently, but don't worry to much about replication. It really just works. -- Stefan
