Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2CB3413364DE for ; Sun, 10 Oct 2010 03:43:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 38581-02 for ; Sun, 10 Oct 2010 06:43:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by mail.postgresql.org (Postfix) with ESMTP id 432B71336473 for ; Sun, 10 Oct 2010 03:43:31 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id DC54DAF98C for ; Sun, 10 Oct 2010 14:43:29 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dioVP+Z1IATa for ; Sun, 10 Oct 2010 14:43:23 +0800 (WST) Received: from [10.1.1.8] (124-148-209-200.dyn.iinet.net.au [124.148.209.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 6A34EAEE65 for ; Sun, 10 Oct 2010 14:43:23 +0800 (WST) Message-ID: <4CB16080.1050406@postnewspapers.com.au> Date: Sun, 10 Oct 2010 14:43:12 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.12) Gecko/20100914 Thunderbird/3.0.8 MIME-Version: 1.0 To: pgsql-performance Subject: Re: large dataset with write vs read clients References: <4CAE3FDB.1040909@2ndquadrant.com> <87ocb3yu10.fsf@mid.deneb.enyo.de> <4CB0E006.8010905@vmsinfo.com> In-Reply-To: <4CB0E006.8010905@vmsinfo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201010/84 X-Sequence-Number: 40503 On 10/10/2010 5:35 AM, Mladen Gogala wrote: > I have a logical problem with asynchronous commit. The "commit" command > should instruct the database to make the outcome of the transaction > permanent. The application should wait to see whether the commit was > successful or not. Asynchronous behavior in the commit statement breaks > the ACID rules and should not be used in a RDBMS system. If you don't > need ACID, you may not need RDBMS at all. You may try with MongoDB. > MongoDB is web scale: http://www.youtube.com/watch?v=b2F-DItXtZs That argument makes little sense to me. Because you can afford a clearly defined and bounded loosening of the durability guarantee provided by the database, such that you know and accept the possible loss of x seconds of work if your OS crashes or your UPS fails, this means you don't really need durability guarantees at all - let alone all that atomic commit silliness, transaction isolation, or the guarantee of a consistent on-disk state? Some of the other flavours of non-SQL databases, both those that've been around forever (PICK/UniVerse/etc, Berkeley DB, Cache, etc) and those that're new and fashionable Cassandra, CouchDB, etc, provide some ACID properties anyway. If you don't need/want an SQL interface to your database you don't have to throw out all that other database-y goodness if you haven't been drinking too much of the NoSQL kool-aid. There *are* situations in which it's necessary to switch to relying on distributed, eventually-consistent databases with non-traditional approaches to data management. It's awfully nice not to have to, though, and can force you to do a lot more wheel reinvention when it comes to querying, analysing and reporting on your data. FWIW, a common approach in this sort of situation has historically been - accepting that RDBMSs aren't great at continuous fast loading of individual records - to log the records in batches to a flat file, Berkeley DB, etc as a staging point. You periodically rotate that file out and bulk-load its contents into the RDBMS for analysis and reporting. This doesn't have to be every hour - every minute is usually pretty reasonable, and still gives your database a much easier time without forcing you to modify your app to batch inserts into transactions or anything like that. -- Craig Ringer Tech-related writing at http://soapyfrogs.blogspot.com/