title: Node.js: a variable in memory compared to redis (or other in-memory key/value store)
body: <p>I'd like to store some info. in a node.js array variable (to be a local cache) that my middleware would check before making a database query.</p>
  <p>I know that I can do this w/redis and it's generally the preferred method b/c redis offers snapshots for persistence and is quite performant, but I can't imagine anything being more performant than a variable stored in-memory.</p>
  <p>Every time someone brings up this topic, however, folks say &quot;memory leaks&quot; make this a bad idea. But why? Why is node.js bad at managing server-side vars?</p>
  <p>Is there a preferred method (outside of an external k/v db store) of managing a server-side array/cache through node.js?</p>