couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Browning <>
Subject Re: Erlang API Discussion
Date Fri, 06 Mar 2009 00:43:08 GMT
On Thu, Mar 5, 2009 at 7:29 PM, Chris Anderson <> wrote:
> I'm not sure having the HTTP wrapper use the API is the best plan, as
> it might turn out to be indirection for indirections sake. If it turns
> out to be simpler to use the Erlang API, then of course lets do, but
> if it is slower or more confusing, than we shouldn't feel like we have
> to.

I'm fine with this, with the caveat that I'd like to reduce code
duplication as much as practical. A good first step could be to write
the Erlang API and later modify the HTTP API to use it if it makes

> +1 to keeping it limited to document CRUD on the first round. View
> queries will be harder to model as they rely on sending side-effects
> out the HTTP socket (maybe replace http socket with gen-server reply?)

I've been trying to figure out for the last few days exactly how view
queries would work in the Erlang API. If we don't have the HTTP API
rely on the Erlang API this becomes much easier and I'm sure we could
come up with a good solution.

> Internally, all database operations are updates, and they are all bulk
> (sometimes with bulk size of 1). I'm not sure how much we want to hide
> this from the user. It might be better to keep the API wrapper thin,
> so the user sees this. Then we can potentially add wrappers so you
> don't have to remember what the structure of a delete is, for
> instance.

I like the idea of growing the API as needed. It sounds like you feel
we could get by with an initial API that just allows you to retrieve a
document and update a document. Is that accurate?

View raw message