concept Redis in category node

appears as: Redis, Redis
Node.js in Action, Second Edition

This is an excerpt from Manning's book Node.js in Action, Second Edition.

Over the course of the preceding section, you added a database module, created a JavaScript API that wraps around it, and tied it in to the RESTful HTTP API. That’s a lot of work, and it will form the bulk of your efforts as a server-side developer. You’ll learn more about databases later in this book as you look at MongoDB and Redis.

Listing 6.20. Fetching a user from Redis
Listing 8.14. Connecting to Redis and listening for status events
const redis = require('redis'); const db = redis.createClient(); db.on('connect', () => console.log('Redis client connected to server.')); db.on('ready', () => console.log('Redis server is ready.')); db.on('error', err => console.error('Redis error', err));

Redis is a popular in-memory, data-structure store. Although many consider Redis to be a key/value store, keys and values represent only a subset of the features Redis supports across a variety of useful, basic data structures. Figure 8.3 shows the usage statistics for the redis package on npm.