Using Redis data structures

Before we build anything, we will cover what data structures Redis supports. We can then discuss what we are building from these structures. Redis is not a database, so it does not have the familiar VARCHAR, INT, DATETIME, or anything like that. Redis is a key-value store. You have a key and you can look up the value of what is stored there. Redis supports a few low-level data types. The first type that we are going to discuss is a string.

Strings are the most basic type and are often the type that we are going to use. Usually, we can serialize almost any data type to a string. If we recall when we used Connect to move the sessions to Redis, we will see that Connect just serializes JSON and stores it as a string. This ...

Get Building Scalable Apps with Redis and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.