Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 27514 invoked from network); 2 Aug 2010 20:35:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Aug 2010 20:35:09 -0000 Received: (qmail 87569 invoked by uid 500); 2 Aug 2010 20:35:09 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 87504 invoked by uid 500); 2 Aug 2010 20:35:08 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 87495 invoked by uid 99); 2 Aug 2010 20:35:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 20:35:08 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.161.180 as permitted sender) Received: from [209.85.161.180] (HELO mail-gx0-f180.google.com) (209.85.161.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 20:35:00 +0000 Received: by gxk22 with SMTP id 22so1963734gxk.11 for ; Mon, 02 Aug 2010 13:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=pi89kz37kmNXO4DLWysHD/0ORzGUAzG/IXB9j9HdGS4=; b=Fjk1baGt42VFNglkTXvP3eTDqtKwtdhtnxahKRTUAF0yJrQhZwZa6N76DlFLB1yJg7 iKhC5rRL3PELbZLxFgiICOnnREPEraD9V5MfZe9nY7+fJVvygAWGgbJOnyUFMspzKqqF kVyY0H0bSgGM0P7cIrfuYIy/gOB+VZVSPnmDE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=eGGD4oimCdUOfJto/snsTv+hktWKiri5vow8oJlCWkMgXv2u5FMDNZuzTX3iYVJ/Em WyxTupWLjiT7nBS3I5v9h15/pgPvDokGMwotYivkomApCpzs1Al6tasQWJBMh8rwlTFs 6R2bzsG0TRJUZjjlQjGRZ6ItXHnSRElubF85A= Received: by 10.151.130.17 with SMTP id h17mr7319188ybn.426.1280781279374; Mon, 02 Aug 2010 13:34:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.31.3 with HTTP; Mon, 2 Aug 2010 13:34:19 -0700 (PDT) In-Reply-To: References: From: Paul Davis Date: Mon, 2 Aug 2010 16:34:19 -0400 Message-ID: Subject: Re: Proposal for changes in view server/protocol To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Aug 2, 2010 at 4:23 PM, J Chris Anderson wrote: > > On Aug 2, 2010, at 1:20 PM, Paul Davis wrote: > >>> To clear things up. >>> >>> There are 2 discussions happing in this thread: >>> >>> 1) what is the ideal API and protocol for a more capable query server? = (especially one that can react differentially to doc update failures, can f= arm work out to multiple cores, etc) >>> >>> 2) how can we be backwards compatible with existing code and make it so= you can respond to an HTML form POST by rendering "whoops, someone else ed= ited that before you did, please retry", or "hey it looks like you failed t= he validation function for reason X" >> >> Thanks for giving me a place to respond to the other side of this thread= . >> >> Reading through the part of this thread that deals with _list and >> _show and _update and seeing how it doesn't really map onto the view >> server semantics very well. >> >> When I think of CouchDB in abstract terms, i think of the core Erlang >> code as the core of CouchDB. The view server (the map/reduce part) is >> behind couchdb. Hidden from the world. >> >> The _list/_show/_update code sits in front of CouchDB and is more of a >> friendly layer to interfacing with CouchDB from client apps. What I've >> noticed is that most of the issues could be solved if the code >> implementing the front side were just implemented separately. Perhaps >> with access to an HTTP client that connects to CouchDB. Or something >> that is more async in nature as has been suggested. >> >> Either way, I wonder if the best answer isn't to separate out the >> responsibility of frontside and backside apps and write two sets of >> JavaScript to deal with both. > > Right. This would be the 1) side of what I talked about up there, as it'd= be useful for CouchDB 2.0. > > For that, maybe a sandboxed Node.js implementation of the show and list, = etc, would be the best solution. > > But I think it'd be better to stick to a single runtime, so if we use emo= nk for views, we should also use it for show and list. > > Chris Erm, I'm thinking more higher level. Whether or not we use something like emonk, or continue with couchjs, I'm just saying that instead of compiling all of the *.js files into a single main.js, we split the two so the front end side can do something entirely different with its implementation, ie allow for a full async API that can do all sorts of crazy things in front of CouchDB. Ie, full app server in front of CouchDB that can do anything it wants because its in front of the security wall. Which is intriguing, because you can suddenly extend features without touching CouchDB. Imagine arbitrary URL handlers and the such at various endpoints. You could reimplement things like batch=3Dok. Or perhaps, time stamping documents. Or perhaps, last write wins semantics. Or perhaps, pages that include multiple lists or shows. Anyway, more higher level like that. Paul Davis