couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Quentin Raynaud (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1722) Add a way to get the document size in validate_doc_update
Date Sun, 24 Mar 2013 17:49:15 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13612161#comment-13612161
] 

Quentin Raynaud commented on COUCHDB-1722:
------------------------------------------

I thought about that but it seems overkill. On a big object it will consume a lot of proc
& RAM while a function that looks up the memory allocations for the object behind would
require very little to get a good enough result.
                
> Add a way to get the document size in validate_doc_update
> ---------------------------------------------------------
>
>                 Key: COUCHDB-1722
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1722
>             Project: CouchDB
>          Issue Type: Improvement
>            Reporter: Quentin Raynaud
>
> It would be cool to add a way to know what is the current document size in validate_doc_update,
maybe by invoking a specific function provided by CouchDB like "documentLength(document)"
on it. The function could also take a boolean as a second argument to include the document's
attachments length or not in the count.
> That would allow to prevent document creation/update if the document looks too big for
its indented purpose. I would like such a possibility to defeat users that try to flood the
database in CouchApps or other applications allowing such a direct access to CouchDB.
> I don't like the idea that right now, a smart user that finds an application with an
API allowing direct access to a CouchDB can easily create some code to use your database as
as extra hard drive for whatever he wants (at least I believe I could do that with some efforts
by simply uploading my files to a random doc that I have write access to and by adding an
index to reference them. This can be done by adding a new attribute to the doc if the validation
is not too strict or by recycling an already existing attribute to such an effect or even
by uploading the index in a specific file too).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message