To use Redis database we need a library to connect to it, the most common library for node is called ioredis. This library is available on npm and have support to all features of Redis.
To install ioredis just execute the following command in your project:
npm install email@example.com —save
As we discussed in the previous session, we will use Redis as a publish/subscriber broker for all messages in our web chat implementation.
Before start using Redis, you need to install it in your machine, you can follow the instructions in the official website on how to install it.
This diagram show what happens when a user send a message on an environment with multiple Node.js servers:
This diagram shows an user (named User A ...