You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Matt Goodall (JIRA)" <ji...@apache.org> on 2009/10/15 17:38:31 UTC

[jira] Created: (COUCHDB-529) Avoiding updating a doc's _rev if nothing changed

Avoiding updating a doc's _rev if nothing changed
-------------------------------------------------

                 Key: COUCHDB-529
                 URL: https://issues.apache.org/jira/browse/COUCHDB-529
             Project: CouchDB
          Issue Type: New Feature
          Components: Database Core
            Reporter: Matt Goodall


Would it be possible for CouchDB to use its deterministic rev algorithm to avoid writing changes to the database if nothing has actually changed in the doc that is sent for update.

The most obvious use case is the user who clicks an HTML form's submit button, instead of using the back button, when they haven't changed anything. I suspect most applications do not check if the user made any changes and therefore end up sending exactly the same data back as an update ... unnecessarily creating a new document rev, growing the database, invalidating views, triggering _changes updates, etc.

If CouchDB could determine that the new document is the same as the old document then it could avoid writing to disc and return the current _rev in the response.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-529) Avoiding updating a doc's _rev if nothing changed

Posted by "Matt Goodall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766103#action_12766103 ] 

Matt Goodall commented on COUCHDB-529:
--------------------------------------

Relevant comments from the mailing list:

"the old revision of the document is part of the content used to generate the hash that becomes the new revision.",  Adam Kocoloski.

"If you don't include the previous document's revision, then your hashes are unidirected and don't form a Merkle tree.", Paul Davis.

So, it may not be possible without the overhead of re-calculating the old hash or something similar.

> Avoiding updating a doc's _rev if nothing changed
> -------------------------------------------------
>
>                 Key: COUCHDB-529
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-529
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Matt Goodall
>
> Would it be possible for CouchDB to use its deterministic rev algorithm to avoid writing changes to the database if nothing has actually changed in the doc that is sent for update.
> The most obvious use case is the user who clicks an HTML form's submit button, instead of using the back button, when they haven't changed anything. I suspect most applications do not check if the user made any changes and therefore end up sending exactly the same data back as an update ... unnecessarily creating a new document rev, growing the database, invalidating views, triggering _changes updates, etc.
> If CouchDB could determine that the new document is the same as the old document then it could avoid writing to disc and return the current _rev in the response.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-529) Avoiding updating a doc's _rev if nothing changed

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis updated COUCHDB-529:
--------------------------------------

    Skill Level: Committers Level (Medium to Hard)

> Avoiding updating a doc's _rev if nothing changed
> -------------------------------------------------
>
>                 Key: COUCHDB-529
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-529
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Matt Goodall
>
> Would it be possible for CouchDB to use its deterministic rev algorithm to avoid writing changes to the database if nothing has actually changed in the doc that is sent for update.
> The most obvious use case is the user who clicks an HTML form's submit button, instead of using the back button, when they haven't changed anything. I suspect most applications do not check if the user made any changes and therefore end up sending exactly the same data back as an update ... unnecessarily creating a new document rev, growing the database, invalidating views, triggering _changes updates, etc.
> If CouchDB could determine that the new document is the same as the old document then it could avoid writing to disc and return the current _rev in the response.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.