couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <>
Subject Re: OTP-ification
Date Mon, 08 Jun 2009 23:55:29 GMT
On Mon, Jun 8, 2009 at 7:39 PM, Adam Kocoloski<> wrote:
> On Jun 8, 2009, at 3:26 PM, Paul Davis wrote:
>> On Mon, Jun 8, 2009 at 3:03 PM, Adam Kocoloski<> wrote:
>>> On Jun 6, 2009, at 1:06 AM, Paul Davis wrote:
>>>> * CouchRep - Ideally, I'd like to keep this in core, but I don't know
>>>> the logic in it to know if we can split it into an Erlang core version
>>>> and add an HTTP layer on top. Or something. Anyway, that's all I got.
>>> The replicator doesn't need an HTTP server, just a client (ibrowse atm),
>>> so
>>> it should not have any dependency on a future "CouchHTTPd" application.
>>>  I
>>> think I'd still prefer to keep it separate from core, though.
>> I meant to layer the protocol so that it could work over Erlang
>> message passing or an HTTP protocol, the goal being that core CouchDB
>> doesn't require HTTP to work, hence why I pulled replication into its
>> own module. I don't actually think we should actually try and make the
>> replicator this abstract, I was more just trying to reason out why I
>> was putting it outside of the core directory.
> Not quite sure I follow your reasoning (are you lumping an HTTP client and
> an HTTP server together as an "HTTP" requirement?), but it's tangential.  We
> both agree that replication code belongs in its own "collection".

I was gonna try and explain, but we agree and the original idea isn't
very clear anyway...

> <snip>
>>> Regardless of how many applications we use, we could still organize the
>>> code
>>> with a multi-level hierarchy like
>>> src
>>>  |-core
>>>  |-couch_db.erl
>>>  |-...
>>>  |-httpd
>>>  |-replication
>>>  |-...
>>> Adam
>> This is possible, but I thought I read that the submodule stuff was
>> another one of those "implemented on a whim and not really supported"
>> Erlang features.
> I think you're referring to packages
> ( -- that's really a
> separate issue from how the modules' source code is organized on disk.  This
> isn't Java :-)

Oh. Wicked. I've only ever seen the horrible Java-ism method of
packages that follow directory structure.

> The snmp and megaco applications (possibly others) are organized this way,
> with nested folders of source code.  Neither one uses packages.

The megaco example definitely made things click. For some reason I
kept assuming that the src and ebin directory structures would be
mirrored but of course there's nothing requiring this anywhere. I'm
down with doing things this way.

> Thanks for getting the ball rolling on this.  I still prefer to build
> CouchDB as one OTP application, but if the community agrees to split it out
> into lots of smaller ones I won't object.  Best,

I'm not at all caught up with the multiple OTP apps other than that
it'd help keep groupings of source files together. Seeing the megaco
example has made me all but throw the idea under the bus. The only
thing I'm left pondering is how best to minimize spaghetti-ness.
Perhaps I can just write a source code analyzer that draws
embarrassing diagrams of dependencies.

As a side benefit, doing things the megaco way sure does make the
refactor path much more incremental.

> Adam

Thanks for the whack on the head,
Paul Davis

View raw message