Redis and Authentication Patterns

This chapter deals with two Express.js topics: Redis and authentication patterns. Redis is a fast database that is often used for storing Express.js sessions.


Redis ( is often used in Express.js applications for session persistence, because storing sessions in a physical storage keeps apps from losing users’ data when a system is restarted or redeployed. It also enables the use of multiple RESTful servers because they can connect to the same Redis server. In addition, Redis can be used for queues and scheduling tasks (e.g., e-mail jobs).

Redis itself is a stand-alone service. ...

Get Pro Express.js now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.