When to use redis in nodejs

Viewed 255

All I know for redis is that it is used to cache for the response, so that we can get the response from memory instead of requesting the server again.

From https://medium.com/swlh/caching-in-node-js-using-redis-3b5400f41699

Below are a few of the reasons we cache:

To save cost. Such as paying for bandwidth or even volume of data sent over the network.
To reduce app response time.

However, I don't understand what is the main factor of deciding whether we should use redis when sending request, maybe use it when the response time is slower than expected?

If redis can help to improve the response time, when don't we use redis for most of the request?

1 Answers

maybe use it when the response time is slower than expected?

Yes. Use Redis will speed up your application.

when don't we use redis for most of the request?

Mostly we use Relational database such as Mysql. It based on Disk while Redis based on Memory. If your server have no much requests, and the response time is acceptable. Redis is not necessary.

Related