Using google memcache in nodejs session - node.js

I would like to migrate from vm to app engine with an node.js app.
How can i use session in this case, I know i should use 'google memcache' to make an cross vm session but how should i do it?
I saw that there are some node module that can store the session in memcache db but the google memcache is different.
Is this the best solution? or should i use mysql db ? i care a lot about the performance of this app.
Thank you for the help.
For the reference:
https://github.com/GoogleCloudPlatform/appengine-nodejs

You don't need to use the appengine-nodejs project here. You automagically get a memcached instance with your app running at memcache:11211, and you can use the standard memcached driver to use it. I put together a quick demo of using express and connect-memcached here:
https://gist.github.com/JustinBeckwith/e25983cd50ab21a6b8ad
You can see it running here:
https://express-memcached-demo.appspot.com/
We will work on getting our docs updated. Hope this helps!

Unless you signed up for the Google App Engine flex memcached alpha, the best (or at least most well documented) way to access memcached on App Engine for a Node.js application is documented here: https://cloud.google.com/appengine/docs/flexible/nodejs/using-redislabs-memcache

Related

What is the best option to do session management in Express Js application?

I am creating a express js application. I will host this application in cloud foundry across multiple servers.
I am looking for any suggest on which option should I use for session management.
You can try express-session module. You can try storing session in database.
express-session
It is an official package from the Express core team. Whether or not it's "good" for production is subjective.
There is a plethora of compatible session stores available as stated in the readme: https://github.com/expressjs/session#compatible-session-stores. Pick the one that's most appropriate for your use case.

How to host nodejs application with sockect.io

I have build an chat application using nodejs with mysql database. I have developed on my windows system and it works fine.
Now I want to make it live on a server to check its real time performance, As a beginner I don't know which server hosting should I choose to develop nodejs application, so someone please suggest me a hosting for nodejs application?
If you want something relatively easy to test on, Heroku will provide you with a free instance.
I can also recommend Azure over Amazon for a simple nodejs based app. The main reason is that Azure has a very simplified interface for deploying node apps after a little bit of minor setup. Amazon offers similar capabilities, but the last time I looked at them they aren't quite as simple to get up and running. Again, they're competitive in cost and reliability, this is just a subjective opinion on what I think will be easier for a dev to get up and running without prior experience.
I use Dokku, an open source solution for a Heroku like PaaS. Either of those are great for doing git style deployments. Heroku has better documentation, and doesn't require your own server so I would start with them.
https://www.heroku.com
http://dokku.viewdocs.io/dokku

App creation with AmpersandJs and Database connectivity

I am creating a nodejs app and as per clients suggestion trying to implement it in AmpersandJs. I have installed framework and created application by following documentation &js installation.
The app is running with some sample data
I found that the sample data is coming from ampersand-app module from an index.js file.
But I want to do database connectivity with it -- How should I achieve this? I have Googled but not found any good link for it.
Did &js is good choice to develop application or it is for an specific type of projects?
But I want to do database connectivity with it -- How should I achieve this?
Ampersand.js is running in the browser. If you want to access data stored in a database you have two options:
Request data from a database running on a server somewhere accessible over the network. In this case you want to use the url property of models/collections
Use an in-browser database (maybe you want to have look at pouchdb as API)
Did &js is good choice to develop applications?
Definitely yes!

Is there a caching library for google datastore api in node.js

I'm looking into using gcloud node api to access the datastore api but was curious if it supported query caching in a similar manner to ndb? If not, what's the best way to make sure repeated queries are cached?
As far as I know, gcloud-node isn't planning to be a full-on ORM (like ndb is for Python). Also, as Patrick Costello noted in the comments above, NDB doesn't cache query results, but individual entities instead.
I think if you want caching of query results (or individual entities), you'd have to manually cache these by running your own Memcache server (http://memcached.org/) and interacting with it using memcached (https://www.npmjs.com/package/memcached)
I ended up using NsqlCache-datastore which is integrated into gstore-node. Guide: https://medium.com/google-cloud/how-to-add-a-cache-layer-to-the-google-datastore-in-node-js-ffb402cd0e1c
Looks like I can use the memcache app engine service accessible through this node library:
https://github.com/GoogleCloudPlatform/appengine-nodejs

Does Nodejitsu support neo4j?

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.

Resources