Redis is a great database for use with Node.js. Both Redis Node.js share similar type conventions and threading models, which makes for a very predictable development experience. By pairing Node.js & Redis together you can achieve a scalable and productive development platform.
Redis Node.js has two primary clients available node_redis and ioredis. Both are available through npm. Both clients have pros and cons, but we generally suggest node_redis, as it has wide support for Redis modules, it is easily extensible and widely used. Ioredis has better integrated support for the Redis Enterprise Cluster API, but this is only relevant if you're specifically using the Cluster API topology instead of the more common Proxy topology. Node_redis’ support for the Cluster API is provided by an additional shim, redis-clustr. Node_redis has built-in support for Redis Enterprise features such as Active Active geo distribution, allowing you to have one database that spans multiple clusters. Node_redis also supports Redis-on-Flash which enables extending your database into Flash SSD storage for warm values and DRAM for hot values. Nodejs redis enables you to integrate such features.
The Node.js community has built many client libraries that you can find here. For your first steps with Node.js and Redis, this article will show how to use the recommended libraries: ioredis and node-redis.
- IO redis
- Node Redis
Step 1. Install the ioredis library using
Find more information about Redis & io-redis connections in the "Redis Connect" repository.
Step 1. Install the Redis library using
Find more information about Redis & node-redis connections in the "Redis Connect" repository.
Redis Marketplace is like an “App Store” for Redis sample apps. You can easily find apps for your preferred frameworks and languages. Below are few of these apps. Click here to access the complete lists of apps.
Basic Redis Caching This application calls the GitHub API and caches the results into Redis.
Redis Rate-Limiting This is a very simple app that demonstrates rate-limiting feature using Redis.
Notifications with WebSocket, Vue & Redis
This project allows you to push notifications in a Vue application from a Redis
PUBLISH using WebSockets.
Build full-fledged Redis applications with Node.js and Express.