How do I use Memcache (on Heroku) from a Node.js service?
There is a Heroku article, explaining how to use Memcache from Ruby, Java and Python. I've asked this question on the Heroku mailing list with no results (my message seems to have been blocked or rejected).
MemJS looks like a good candidate.
MemJS is a pure Node.js client library for accessing the MemCachier service and other memcache servers. It uses the binary protocol and support SASL authentication.
You can follow the steps in the Heroku Ruby tutorial (http://devcenter.heroku.com/articles/memcache) to gain a basic understanding of how to interface with memcache on Heroku, but to do the same in node you should use the node-memcache library (https://github.com/elbart/node-memcache).
I hope this helps.
node-memcache will not work with any of the memcache providers on Heroku. In particular, the library uses the text protocol, rather than the binary protocol and doesn't support SASL authentication. MemJS does both (as Jacob pointed out)
Related
I need to make a Meteor website into an OAuth 2 server and I'm not finding a lot available. There are lots of OAuth clients:
https://atmospherejs.com/meteor/oauth
https://atmospherejs.com/meteor/oauth1
https://atmospherejs.com/meteor/oauth2
But few servers/providers.
https://atmospherejs.com/khanghoang/oauth2-provider - Basic, not fully functional
I can't tell is this provides server capabilities as the documentation is light:
https://atmospherejs.com/meteor/accounts-oauth
I'm considering converting thomseddon's node-oauth2-server over to a meteor package, but want to know if there is something else available:
https://github.com/thomseddon/node-oauth2-server
I work for Prime8Consulting and we just finished writing an oauh2 client/server package for meteor. It has lots of documentation and example applications that demonstrate how it works. https://github.com/prime-8-consulting/meteor-oauth2
We are excited to get feedback.
I'm learning websockets and just learned how to use sub/pub using cboden/ratchet example push integration as my server and autobahnjs for my browser. my question is does ratchet or autobahn supports rpc?
If you have any sources or examples it's highly appreciated. cheers!
I'm currently evaluating the different cloud service providers to determine which is best for the use of NodeJS backend with Socket.IO implementation that is speedy. While i know that is really dependent on the physical location of their servers, i hope there is one in south-east asia.
I've already deployed on the following:
Amazon EC2
Heroku
Appfog (doesnt seem like it works on it)
Any other good ones to recommend? Would be good if they have a free tier much like how AWS works.
Look forward to your opinions!
Note that at this time Heroku does not support web sockets, so any use of socket.io will have to degrade to a long-polling approach.
With your use of Socket.io in mind, I would recommend using Amazon EC2. The main advantage of many other hosting options in the past has been their easy of deployment and management of all your resources (think Heroku). Amazon has recently launched OpsWorks, which you can use to take care of most of that for you. If you don't have any complex, custom requirements then the basic Node set up should work for you.
Keep in mind that if you are using OpsWorks there are a few small things to keep in mind. Some of them are discussed in this question. Has anyone been successful deploying a node (express) app with Amazon OpsWorks?
#Nick Mitchinson gave an amazing answer. Also you can have a look into the Elastic beanstalk. AWS recently released Paas version of Nodejs.
Websocket is now supported on Heroku by the way.
I want to use Nodejitsu to host my Node.js app. The app also uses Neo4j. Does Nodejitsu provide any kind of support for that? Or do I need to host Neo4j separately (and pay for all network traffic)?
Nodejitsu doesn't support native Neo4j integration. If you can host a Neo4j service or find one you can use it, and for node.js applications you can use the neo4j api with https://github.com/thingdom/node-neo4j
I will try to find the best answer for you, if I can find anything about Neo4j hosting i will update this question.
I set up my Heroku instance to have Memcached, so now I have the MEMCACHE_PASSWORD, MEMCACHE_SERVERS and MEMCACHE_USERNAME env variables. How do I use them with any of the existing node.js memcached libraries? They all seem to take in just a host and port (I'm assuming the port is the default 11211?).
Thanks
As mentioned above, both Memcache addons on Heroku only support the binary protocol. I wrote a library, MemJS, that works with these addons (supports SASL with the binary protocol and recognizes the Heroku environment variables out of the box).
As of today, there is no Node library available that supports this scenario. Heroku's memcached instances use SASL for authentication. None of the currently available libraries support this, and there doesn't seem to be much momentum to add support, either.
If you want to try to implement this yourself, it might be worth taking a look at sasljs, which is a Node binding around GNU SASL. Your best bet would probably be to fork node-memcached and add SASL support there.
https://github.com/elbart/node-memcache
var client = new memcache.Client('11211', 'http://xxxx:xxxxx#mc10.ec2.northscale.net');