1

Just wonder if I need to store the temporary data in memory array or database(nosql)?

Is there any performance difference?

Somebody said nodejs is very dangerous to cache data in memory, it may lead to memory leak. And it cannot afford big data.

Your comment welcome

3
  • 1
    i would just use redis Commented Mar 10, 2014 at 3:51
  • It would lead to memory leaks only if you are not careful. A memory leak is nothing but holding on to the references of a variable. Closure in javascript makes things even murkier. I would take @AJcodez's suggestion and use redis and set an expiry on each record. Commented Mar 10, 2014 at 5:06
  • thanks I will use redis for prompt programming Commented Mar 10, 2014 at 5:36

1 Answer 1

1

There are a number of options as storage media, but you are probably best profiling your specific application and making a determination. You may find that the overhead of connecting to storage, storing and retrieving data outweighs any improvements in your memory footprint. You might find the opposite - you will need to profile your application to know.

The NPM package look is very useful for this type of thing: https://www.npmjs.org/package/look.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.