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 LiveJournal.com, 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)?

29 comments:

Anonymous said...

Rakesh,

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.

cheers

Anonymous said...

Doh!

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

http://forums.aptana.com/viewforum.php?f=51

Jarret said...

Rakesh,

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...

jminkler,

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...

CG,

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...

Impressive!

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

BEST SITE said...

"MY PROGRAMMER IS TRYING TO CONVINCE ME TO MOVE TO .NET
FROM PHP. I HAVE ALWAYS DISLIKED THE IDEA BECAUSE OF THE EXPENSES.
BUT HE'S TRYING NONE THE LESS. I'VE BEEN USING WORD PRESS ON A NUMBER OF WEBSITES
FOR ABOUT A YEAR AND AM NERVOUS ABOUT SWITCHING TO ANOTHER PLATFORM.
I HAVE HEARD GREAT THINGS ABOUT BLOG ENGINE IS THERE A
WAY I CAN TRANSFER ALL MY WORD PRESS POSTS INTO IT? ANY KIND OF HELP WOULD BE GREATLY APPRECIATED!"

야설
오피헌터
외국인출장
마사지
카지노

baccaratsite.top said...

Thank you for providing a good quality article 바카라사이트

casinositezone.com said...

I have been looking for articles on these topics for a long time. I don't know how grateful you are for posting on this topic. Thank you for the numerous articles on this site, I will subscribe to those links in my bookmarks and visit them often. Have a nice day 스포츠토토

baccaratsite.biz said...

This is the perfect post. It helped me a lot. If you have time, I hope you come to my site and share your opinions. Have a nice day. 온라인카지노

slotmachine777.site said...

Hi there, the whole thing is going well here and of course everyone is sharing information, that’s really fine, keep up writing. 슬롯머신사이트

softeir said...

Really Good Work Done By You...However, stopping by with great quality writing, it's hard to see any good blog today.
ScreenHunter Crack

먹튀검증업체 said...

Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon 먹튀검증업체 I would like to write an article based on your article. When can I ask for a review?!

sportstotohot.com said...

Very interesting information!Perfect just what I was looking for!
토토사이트

racesite.pro said...

This website and I conceive this internet site is really informative ! Keep on putting up!
경마

totosite365.info said...

Hello there! I just wish to offer you a big thumbs up for the excellent info you have got here on this post. 토토사이트

CasinoMecca said...

CasinoMecca

토토사이트추천 said...

I've been using WordPress on a number of websites for about a year and am worried about switching to another platform. I have heard good things about 토토사이트추천. Is there a way I can transfer all my wordpress content into it? Any help would be really appreciated!

oncasino said...

oncasino

슬롯커뮤니티 said...

I'm very curious about how you write such a good article. Are you an expert on this subject? I think so. Thank you again for allowing me to read these posts, and have a nice day today. Thank you. 슬롯커뮤니티

Anonymous said...

Thanks for sharing this great site Class-Action-Lawsuits

Anonymous said...

You have clearly put in an enormous amount of work. Well done. Very informative. Thanks Sec Lawsuit

Anonymous said...

Nice site. Keep up the great work Financial Fraudster

Anonymous said...

I love seeing this in here and would like to read more! Sec Law 360

Anonymous said...

GREAT POST
https://chancecdxm696.exposure.co/forget-bluegreen-lawsuit-settlement-3-replacements-you-need-to-jump-on?source=share-chancecdxm696

Anonymous said...

This is important, though it's necessary to help you head over to it weblink: https://canvas.instructure.com/eportfolios/1417012/rowanueip163/11_Faux_Pas_That_Are_Actually_Okay_To_Make_With_Your_Stock_Broker_Fraud_Attorney

ShareThis