Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 29639 invoked from network); 14 Mar 2009 12:11:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2009 12:11:24 -0000 Received: (qmail 41383 invoked by uid 500); 14 Mar 2009 12:11:18 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 41353 invoked by uid 500); 14 Mar 2009 12:11:18 -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 41342 invoked by uid 99); 14 Mar 2009 12:11:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Mar 2009 05:11:18 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Mar 2009 12:11:09 +0000 Received: from [10.0.1.7] (f053037037.adsl.alicedsl.de [::ffff:78.53.37.37]) (AUTH: LOGIN jan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Sat, 14 Mar 2009 12:10:48 +0000 Message-Id: <84D516F0-BCEF-4730-925B-D5C27E1A591D@apache.org> From: Jan Lehnardt To: user@couchdb.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Use couchdb as the data store for real-time chat room Date: Sat, 14 Mar 2009 13:10:16 +0100 References: <82964F3E-9C96-4784-8280-01B4155E999D@jasondavies.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On 14 Mar 2009, at 12:32, howard chen wrote: > Hi, > > On Sat, Mar 14, 2009 at 6:57 PM, Jason Davies > wrote: >> CouchDB gives you a lot more for >> free (flexible schema, replication and in general designed for high >> scalability) so I would recommend giving it a try. >> > > Sure will have a try later on. > > >>> 2. Is Memcached useless if I am using couchdb? >> >> I'm guessing memcached would still be useful as a caching layer to >> squeeze >> that extra bit of speed if you have the RAM, but maybe someone else >> can >> speak from experience. >> > > The reason I ask is since couchdb output JSON, so ideal case is to let > users contact couchdb directly in term of scalability. If adding a > cache layer using Memcached which eat data from HTTP response seems > too much overhead involved as Memcached is a also key-value store. > > Don't know if couchdb has some kind of query cache and how to tune? > Oh..maybe I should use squid? CouchDB uses the filesystem buffer as a cache. CouchDB's b-tree storage is a fairly thin layer on top of the filesystem and you should get decent caching characteristics out of the box. Of course, no requests are better than cached requests. View results come with HTTP ETags that allow you to find out if a client would need to re-fetch an item. Squid* and Varnish do file caching as well where there might be faster than CouchDB but probably not magnitudes. A memory-based HTTP cache might help you (nginx & memcache), but I think you can go a long way with pure CouchDB and HTTP caching alone. (* There is an anecdote on the web where Squid tries to outsmart the filesystem buffer cache and ends up doing two disk-to-memory operations where one would do, I can't seem to find the reference right now). Cheers Jan --