Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.
The "Partial_Updates" page has been changed by MarkHahn: http://wiki.apache.org/couchdb/Partial_Updates?action=diff&rev1=4&rev2=5 <<TableOfContents(3)>> - Future versions of Couch DB are expected to have a partial update feature. Partial updates can be issued now with current versions of Couch using the existing update handler feature. + Future versions of Couch DB are expected to have a built-in partial update feature. However, partial updates can be accomplished now with current versions of Couch using the existing update handler feature. While one may write their own update handler for this purpose, an example is given here that anyone can use. - == What is a partial update == + == What is a partial update? == - A partial update is a single HTTP request to Couch that is similar to a normal update (PUT). However the partial update request contains only information for updating (or deleting) one or more fields (or sub-fields) of a doc. Only the change information needs to be sent over HTTP, not the entire doc. + A partial update is a single HTTP request to Couch that is similar to a normal update (PUT). However the partial update request contains only information for updating (or deleting) one or more fields (or sub-fields) of a doc. - === Why is a partial update useful === + === Why is a partial update useful? === + + A partial update is more efficient than a normal full update. Only the change information needs to be sent over HTTP, not the entire doc. In general, changing of a single field in a doc requires reading the doc, changing it, and then putting the doc back to the DB. A partial update only needs the ID of the doc in order to make the field change. + + Also, partial updates allow the code in an app, or multiple apps, to be partitioned into multiple pieces where each piece of code only knows about one part of the DOC. In many cases this allows for a better separation of concerns. + + As an example, a routine may called with only the doc ID and then the routine may at any time update part of a doc without ever having a full copy of the doc. This is especially important when accessing a single DB from multiple apps (or workers) where a single copy of a DOC can't be shared. +
