why is node server easier for maintaining state between requests?

128 views
Skip to first unread message

josh

unread,
Jul 9, 2012, 4:12:09 AM7/9/12
to nod...@googlegroups.com
this is Mikeal's presentation from 'Keeping It Realtime Conference'
watch minute 7:30-8:30.  

he say that node, unlike ruby/php/python allow you to store your cache in the server process and instead of an external process (i assume memcached is a common one).
is that due to the fact that we use closures in js, so all the variables are available to all the callbacks?
Does it mean to store my state in simple variables like array and hashes?
I know that a node process has only 1.7GB of memory due to a v8 limitation. isn't it a problem in that regard?

also, can't you have state in ruby by using public variables on the server that are available to any request?               

Tim Caswell

unread,
Jul 9, 2012, 11:14:09 AM7/9/12
to nod...@googlegroups.com
Yes, any long-running script can store state inside the script.  In node servers these are available through closures or other means (properties on shared modules).  Don't store gigabytes of data here.  If you have any serious storage requirements, it's probably best kept in something better suited than the javascript heap as objects.

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply all
Reply to author
Forward
0 new messages