redis

concepts

[https://medium.com/@stockholmux/from-sql-to-redis-chapter-1-145c82e4baa0|from sql to redis]

type hash for tables and rows

namespace:table:id

HSET gianoauth:realms:users:scipio name "Stefano Scipioni"
HSET gianoauth:realms:users:scipio username "scipio"
HSET gianoauth:realms:users:scipio password "hash"

add an INDEX with sets: collections of strings that are unordered and cannot contain duplicates

SADD gianoauth:realms:all-users gianoauth:realms:users:scipio

use multi exec to surround HSET and SADD

MULTI
HSET ...
HSET ...
SADD ...
EXEC

sorted set: like a set a sorted set only allows members without repeats, but also allows you to specify a score

ZADD gianoauth:realms:priceIndex 10.99 scipio

gui

fastoredis

server

sudo apt install -y redis-server redis-tools