Archive for July, 2009

Speak – JavaScript Chat Server

Posted by Josh on July 16th, 2009

This is a rather technical description of a technology created by us at Lusion Technologies. While it may eventually be usable by any website owner it is only intended for developers at the moment. If you are interested in a simple demonstration of the server, you can take a look at http://www.lusion.co.za/labs/speak/

Creating a javascript chat script has become a trivial task with the latest JavaScript frameworks – but the idea of a PHP & MySQL setup to deal with the users is excessively wasteful. Most chat systems use a polling system where it checks if there are any new messages every few seconds… with a lot of users it can quickly add up to many hundreds of connections per second and when each connection has to pass through Apache to PHP before it is processed it really adds up fast. Keeping connections open help out enormously but when everything is still passing through Apache and each connection with its own PHP process which in turn stores everything in a database – there had to be a better solution.

Speak is an efficient message server written to solve the problem of slow online chat back-ends. It uses a back to basics method of public channels which every application using the message server uses. Messages can be written to a channel with a simple HTTP call to URL such as http://speak.lusion.co.za/write?channel=test&message=howdy, and can be read using a URL such as http://speak.lusion.co.za/read?channel=test&from_id=1. Since there is no way of listing the current channels, private channels can create just by using a secret name. (more…)

Posted in JavaScript | No Comments »