0

I'm writing a node.js software module which stores a number of strings of varying length in an object map. This is essentially serving as a in memory cache for my overall software.

I was wondering how do I account for the fact that more memory will be used up the longer my application is running and I understand node processes by default have a memory limit imposed by the v8 engine.

I have already put in place code which after a certain time removes old cache entries but this does not protect against a lot of cache entries being placed in a short amount of time.

1
  • 4
    you could use memcached which was designed for cacheing Commented Mar 28, 2013 at 15:35

1 Answer 1

2

As dm03514 says, use a dedicated cache component. Memcached will do this for you, as will Redis.

The main problem you will face is invalidation, both of these allow you to set expiry times for keys.

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.