O'Reilly logo

Mastering Reactive JavaScript by Erich de Souza Oliveira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to Redis

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 ioredis@2.5.0 —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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required