Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1CC6F102DD for ; Thu, 14 Nov 2013 23:56:31 +0000 (UTC) Received: (qmail 59831 invoked by uid 500); 14 Nov 2013 23:56:29 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 59793 invoked by uid 500); 14 Nov 2013 23:56:29 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 59785 invoked by uid 99); 14 Nov 2013 23:56:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2013 23:56:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jens@couchbase.com designates 206.225.164.29 as permitted sender) Received: from [206.225.164.29] (HELO EXHUB020-2.exch020.serverdata.net) (206.225.164.29) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2013 23:56:23 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.151]) by EXHUB020-2.exch020.serverdata.net ([206.225.164.29]) with mapi; Thu, 14 Nov 2013 15:56:02 -0800 From: Jens Alfke To: "user@couchdb.apache.org" Date: Thu, 14 Nov 2013 15:56:01 -0800 Subject: Re: show/list Thread-Topic: show/list Thread-Index: Ac7hlRIRgAdWPPIZQembwp/e/keJMQ== Message-ID: References: <75175787-0293-4918-9CC3-0CE24B8B41C6@programmazione.it> <6EDDA679-1FA3-4C68-88A5-13C54B6E97DF@couchbase.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On Nov 14, 2013, at 2:19 PM, Benoit Chesneau wrote: > I have examples in prod that shows that not anyone is sharing the same > opinion as you ;) There are plenty of example where lists and shows can b= e > used. I=92m sure there are. They=92re just not particularly useful when the datab= ase is embedded inside the app. The kind of postprocessing list/show functi= ons do is useful when the client and server are widely separated since it s= aves you a lot of round-trips and can massage data into the form a client e= xpects. That=92s not an issue when the app and db live within the same proc= ess. > Where > the use of lists and shows, the fact that you can replicate them (which i= s > possible when you use ios and android outside the app store in entreprise= s > or private events) is a huge advantage. You can implement list/show functions outside the database. You can even pu= t them in a library function in your CouchApp and replicate them that way. = They=92re just handy utilities, not actual database functionality. > Why some person are using > SQL? Because they can query the data. Why woud you like to have shows and > lists or any feature like this? Because you eventually build your own way > to query your data. I=92m not saying the ability to postprocess query results isn=92t useful. I= =92m just saying that list and show functions are a hacky way to do it. The= y remind me of old CGI programs that painstakingly assembled HTML by string= concatenation, instead of using something like a template language. And th= e fact that they=92re manipulating the results in text form makes them inef= ficient and prone to errors. Ideally you=92d transform the data directly as= objects instead of having to convert them into text that then gets parsed = by something else. =97Jens=