Redis
Redis 是完全开源的,遵守 BSD 协议,是一个高性能的 key-value 数据库
基础用法
安装和启动
$ brew install redis # 安装
$ brew services start redis # 启动
$ brew services stop redis # 停止使用
➜ redis-cli
127.0.0.1:6379> SET mykey "hello world"
OK
127.0.0.1:6379> GET mykey
"hello world"
127.0.0.1:6379>NodeJs 连接
在 NodeJs 中,可以使用 redis/node-redis 进行连接
$ npm i redis
或者使用另一个也很流行的库 redis/ioredis