Re: Decide between Postgresql and Mysql (help of

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux