X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 7AC8C11F68FD for ; Tue, 28 Mar 2006 17:18:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19545-01-2 for ; Tue, 28 Mar 2006 17:18:36 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from peufeu.com (boutiquenumerique.com [82.67.9.10]) by postgresql.org (Postfix) with ESMTP id 54B1211F6796 for ; Tue, 28 Mar 2006 17:18:33 -0400 (AST) Received: (qmail 13458 invoked from network); 28 Mar 2006 23:18:40 +0200 Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) by boutiquenumerique.com with SMTP; 28 Mar 2006 23:18:40 +0200 Date: Tue, 28 Mar 2006 23:18:39 +0200 To: Marcos Subject: Re: Decide between Postgresql and Mysql (help of References: <1143559902.1241.16.camel@servidor> <1143572392.3625.79.camel@state.g2switchworks.com> <1143564928.1241.28.camel@servidor> Cc: pgsql-performance@postgresql.org From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <1143564928.1241.28.camel@servidor> User-Agent: Opera M2/8.51 (Linux, build 1462) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.112 required=5 tests=[AWL=0.112] X-Spam-Score: 0.112 X-Spam-Level: X-Archive-Number: 200603/564 X-Sequence-Number: 18001 >> So, what exactly are you planning on doing? > > The application will be a chat for web, the chats will be stored in the > server. In a determined interval of time... more or less 2 seconds, the > application will be looking for new messages. > > I believe that it will make many accesses. The write in disc will be > constant. Ah, cool. That's exactly what a database is not designed for xD Try this, I coded this in about 1 hour as a joke last week. http://peufeu.com/demos/xhchat/ It works in firefox and opera, uses xmlhttprequest, and the messages are stored in a dbm database. We have also coded a real HTTP chat. I'll briefly expose the details on-list, but if you want the gory stuff, ask privately. There is a Postgres database for users, authentication, chatrooms and stuff. This database can be modified by a full-blown web application. Of course, messages are not stored in the database. It would be suicidal performance-wise to do so. An asynchronous HTTP server, using select() (lighttpd style) is coded in Python. It is very special-purpose server. It keeps an open connection with the client (browser) and sends messages as they arrive in the chatroom, with no delay. The connection is interrupted only when the client submits a new message via a form, but this is not mandatory. My memories are a bit old, but we benchmarked it at about 4000 messages/second on a low-end server (athlon something). Concurrent connections are unlimited. Disk I/O is zero. I like it. If you store messages in the database, you can hope to be about 10-50 times slower.