Made in Heaven

Redis (REmote DIctionary Server) is a persistent key-value database with built-in net interface written in ANSI-C for Posix systems. Whilst it may at first seem like the wheel is being reinvented here, the need for something beyond a simple key-value database is pretty clear. It’s possible to use Redis like a replacement of memcached, with the main difference being the dataset is stored persistently – not volatile data – and Redis introduces new data structures such as list and sets. Furthermore, it implements atomic operations in order to interoperate with these data structures.
I released a PHP extension called phpredis a couple of weeks ago, which works as a PHP client API for Redis. The project is hosted at Google Code at the moment, and you can get the code directly from the SVN repository: http://phpredis.googlecode.com/svn/trunk/.
Despite a vanilla PHP client library already exists, I felt the need to write it since a PHP extension normally performs better and I wanted to make the most of Redis potential.
Let’s see a snippet of how to make a simple operation to Redis using the PHP client:
$redis = new Redis();
$redis->connect(‘127.0.0.1’, 6379);
$redis->set(‘key’, 27);
echo $redis->get(‘key’); // it should print 27
$redis->incrby(‘key’, 3);
echo $redis->get(‘key’); // it should print 30
The code above was quite obvious, it stored a value associate to key and it increments its value by 3. Let’s see another snippet a bit more complex, for example using a list:
$redis = new Redis();
$redis->connect(‘127.0.0.1’, 6379);
$redis->lPush(‘list’, ‘val’);
$redis->lPush(‘list’, ‘val2’);
$redis->lPush(‘list’, ‘val3’, 1);
echo $redis->lPop(‘list’, 1); // it should print val3
echo $redis->lPop(‘list’); // it should print val2
echo $this->lPop(‘list’); //it should print val
Notice that depending on the last optional parameter (0 by default) it’s possible to append/extract an element to/from the tail or to/from the head of the list.
There is a list including all the available methods. At the moment, I’m working on the implementation of more new Redis commands and on the support for complex data structures such as arrays and PHP objects.
Apart from phpredis, there are more client API for languages as Perl, Python, Ruby and Erlang. You can find this and more at the Redis project homepage. Redis has been written by Salvatore Sanfilippo who I’m chuffed to bits with.
Ted Neward, a consultant with ThoughtWorks and the principal of Neward & Associates, has published a list of libraries, tools and other resources - such as books, conferences or weblogs - any up-and-coming Java developer should have. The Java platform will be celebrating its 14th birthday soon, and it’s time to revise the story of one of most extended languages.

Link | Essential Java resources
PHP.JS is a project with the purpose of porting standard PHP functions over to Javascript. The project was taken up by Kevin van Zonneveld, a dutch developer who had developed a small JS library of PHP functions for his job. Kevin shared the library on his blog and came into Open Source. Then many developers made contributions with new PHP functions written in JS and this is how the spark caught flame.
It offers added functionality on top of JS with functions like md5(), file_get_contents(), and utf8_encode().
Official site | PHP.JS
Disclaimer: I’ve contributed to the project with a couple of functions
th3j0ker@alexandra:~$ echo hello hello th3j0ker@alexandra:~$ ^hello^bye^ echo bye bye