Skip to content

NodeSchoolSF/workshop-nodejs-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Node.js + Redis Workshop

This is a beginners workshop for Node.js engineers who would like to work with Redis.

Approach

In this workshop we'll get to know some of the data structures provided by Redis. We'll first use the Redis CLI tool (redis-cli, a REPL) to issue commands and see their responses. Then, we'll go ahead and write Node.js code to make use of the same data structures.

Either check out this repository, or download a zip file of the repository. Inside you will find two directories. The first, code/, is where we'll write our application code. The second, lessons/, is where we'll be teaching from.

Takeaways

Once the workshop is done, you'll understand a few things about Redis:

  • The basic data types
  • How to use Redis from a Node.js application
  • When to use Redis vs other technologies

Pre-Requisites

Try to do the following before coming to the workshop. If not, that's okay too.

Install Node.js

Install Redis

macOS with Homebrew

If you have Homebrew installed, then follow along with these instructions. If you don't already have Homebrew installed it's worth giving it a try, as it's very beneficial to installing other software on your Mac.

$ brew install redis # this installs Redis
$ redis-server # this starts the server

# switch to a new terminal window

$ redis-cli PING # this sends a command to redis
> PONG # if you get this message back then it worked

$ redis-cli # use this for an interactive Redis REPL

Linux with Apt

If you're using Ubuntu / Debian / Linux Mint, then this is for you. We can download the Redis source code and install it.

$ sudo apt-get update
$ sudo apt-get install build-essential
$ curl -O http://download.redis.io/redis-stable.tar.gz
$ tar xzvf redis-stable.tar.gz
$ cd redis-stable
$ make
$ sudo make install
$ redis-server # this starts the server

# switch to a new terminal window

$ redis-cli PING # this sends a command to redis
> PONG # if you get this message back then it worked

$ redis-cli # use this for an interactive Redis REPL

Any OS with Docker

$ docker run \
  --name nodeschool-redis \
  -p 6379:6379 \
  -d redis \
  redis-server

# switch to a new terminal window

$ docker exec -it nodeschool-redis redis-cli PING # this sends a command to redis
> PONG # if you get this message back then it worked

$ docker exec -it nodeschool-redis redis-cli PING # use this for an interactive Redis REPL

About

A beginners workshop for using Node.js with Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published