Wednesday, January 21, 2009

JsMemcached.js - A Jaxer client for memcached

Two days ago, on a lazy evening, I started work on my first solid Jaxer project — building a memcached client. As a testimony to the elegance of JavaScript, it took me less than 2 hours to get a basic memcached client up and running.

What is memcached, you ask? From the memcached website:

memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

What it does is, lets you use excess RAM on your server machines as temporary stores of data, so that you can avoid going to your DB when you want frequently accessed data. Needless to say, accessing data from RAM is much faster. Since the creation of memcached for, memcached has become the cheapest and fastest way to scale a website.

Now, my implementation is not feature complete, nor at peak performance, but I aim to take it there. Even so, I decided to get my code out and available for everyone to see, so that people can tell me what they think of it.

You can go to the Google code page for the JsMemcached-client project, or download the code right away. Though limited in features and with a possible bug in an edge case in the get call, you can start using this already.

This is my first open-source project, so please don't be too harsh in your feedback.

Help needed: I need to figure out how to performance-optimize this code. Either I need to get rid of that loop in the get call, or I need to write a wrapper around libmemcached. I would prefer the latter, since I have to add more features for feature-completeness. Any idea on how I can get Jaxer to talk with libmemcached (or any other such out-of-process thing)?


Anonymous said...


davey from aptana here, nice work, i develop the javascript framework for jaxer, if you post a link for this on the jaxer forums, i'm contact you via a pm and hopefully help you move forward with you lib.

again nice work.


Anonymous said...


link to the forums, in case you dont have it at hand.

Jarret said...


How do you prevent malicious users from calling these methods on their own and filling your server with bad data? Or am I not understanding the jaxer stack?

Pretty cool idea!

Rakesh Pai said...


Jaxer is a "environment" for running JavaScript on the server. JsMemcached is design to run only on the server. The user doesn't ever have access to this library in the browser.

Chaitanya Gupta said...

Does it handle binary data?

Rakesh Pai said...


Right now, no. I think I'll be adding the ability to parse binary data in the next release.

I am just concerned about performance, because of the way I'll have to read binary data from the server. Once I crack that, it'll be in trunk.

omega said...


jonny said...

dr.web antivirus crack
daemon tools ultra serial key
screenhunter pro crack
macx video converter pro crack
goodsync crack
coolutils total pdf converter crack
goldwave crack
pgware gameswift crack
rekordbox dj crack
mindomo desktop crack

softeir said...

Amazing! Its a genuinely remarkable piece of writing, I
have got much clear idea on the topic from this post.
ScreenHunter Crack