3

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

Dor Shay
  • 189
  • 11

2 Answers2

3

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!

Justin Beckwith
  • 7,686
  • 1
  • 33
  • 55
1

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

quetzaluz
  • 1,071
  • 12
  • 17