Slide 11
Slide 11 text
GET redis:data.types:string
Strings are the most basic kind of Redis value. A value is mapped to a key
We could use SET and GET commands to set and get keys
Redis Strings are binary safe, this means that a Redis string can contain any
kind of data, for instance a JPEG image or a serialized Python object.
Thanks to this, we could use it for different types of use cases:
● Integer/float: As a counter (INCR, DECR, INCRBY, INCRBYFLOAT...)
● Bit: as bitmaps/binary stuff (SETBIT, GETBIT, BITCOUNT, BITOP...)
● String: regular DB (APPEND, GETRANGE...)
redis 127.0.0.1:6379> set "key" "value"
OK
redis 127.0.0.1:6379> get "key"
"value"
- A String value can be at max 512 Megabytes in length!
- Integer commands (INCR, DECR...) in redis are Atomic!