couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: Modifying fields
Date Fri, 13 Jun 2008 08:53:32 GMT

On Jun 13, 2008, at 01:40, Brad Schick wrote:

> Thanks for the feedback.
>
>
> On 06/12/2008 03:21 PM, Jan Lehnardt wrote:
>>> Follow up questions on this: Does CouchDB internally track and  
>>> reference
>>> individual fields? Or is the json for each document basically a  
>>> blob to
>>> everything except View code?
>>
>> Documents are stored into native Erlang types representing each
>> document. Except for the view server, no-one cares about what
>> a document look like.
> So the DB just treats each document like a string I assume? I was  
> hoping
> it actually understood the fields. If it doesn't know about fields,  
> then
> I understand that it might not be that much more efficient doing  
> things
> on the server.
>
> But I'm curious; if the Erlang code doesn't look inside documents  
> why do
> I get errors if I pass just a json array as the body of a document? It
> seems to require a json object with named pairs.

No no, CouchDB definitely looks at the JSON structure.

> My data-model is still a work in progress, so perhaps I won't really
> need to update lots documents in sequence. Mostly I've been thinking  
> of
> maintenance examples. Like, every value for some textfield needs to be
> escaped and written back to the DB after there are already a million
> documents containing that textfield in the DB.

Yeah, that's a sort of valid use-case and CouchDB is not a very good
fit for that. But if it is maintenance, it might be okay to be slower :)


> It would be interesting to know the load on the DB of doing something
> like that inside the server versus sending and receiving all million
> documents to the client.

You'd save all HTTP handling. So things would be faster. We are at a
point with CouchDB where we are working on getting it right and not
getting it fast or adding features for all edge cases. I'm not saying  
that
CouchDB will never get a feature that helps you, but it is not yet a
priority.

Cheers
Jan
--

Mime
View raw message