Redis: Quick Start & Command Example
This post shows how to start using Redis.
What is Redis?
"Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker"
install on mac
brew install redis run
redis-server CRUD
> GET key1
(nil)
> SET key1 val1
OK
> GET key1
"val1"
> SET key1 val2
OK
> GET key1
"val2"
> DEL key1
(integer) 1
> GET key1
(nil)
keys
> SET key1 val1
OK
> SET key2 val2
OK
> SET a1 b1
OK
> KEYS key*
1) "key1"
2) "key2"
> KEYS *
1) "a1"
2) "key1"
3) "key2"
> flushall
OK
> KEYS *
(empty array)
etc
- ping: ping server
- info: get info & stats
- monitor: listen to requests
Comments
Post a Comment