Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I connect Redis directly in JavaScript? [closed]

Browsing official available clients for Redis (https://redis.io/clients) it seems that there is no current client for JavaScript/TypeScript client library.

Am I right?

Is such a client simply missing or there is a reason why it cannot/should not exist?

like image 748
remus Avatar asked Oct 27 '25 06:10

remus


2 Answers

There's a Redis binding for Node.js on Github:

http://github.com/fictorial/redis-node-client

and you can try node.js without any need for persistence.

If you have questions, right now it's best to show up on Freenode #node.js or the mailing list on Google Groups.

like image 110
chakrit Avatar answered Oct 28 '25 18:10

chakrit


Unfortunately javascript can only communicate via HTTP or Websockets.

Here's an idea:

Embed a .swf in your page and write javascript callbacks for an actionscript redis client. https://github.com/claus/as3redis

This would have less network overhead than implementing something like http://webd.is/ or any other server-side redis client.

You should be reducing network overhead everywhere possible. While the following may be fast, we may still be able to do better.

step 1 ajax call -> php -> redis

step 2 redis -> php -> ajax return

....that's at least two separate tcp connections if your redis server is not on the same server as your backend application.

Why not cut out the middle-man and write javascript callbacks to actionscript redis calls?

Here's why: -You may not want to expose your redis server to the internet. -A client-side dependency on flash for your data retrieval may not be the best solution in terms of robustness.

I'd like to code this up someday and see how it performs. Let me know if you try it out!

like image 45
adkatrit Avatar answered Oct 28 '25 19:10

adkatrit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!