Redis is an open source, in-memory data structure store that can be used as a database, cache, or message broker. It supports data structures like strings, hashes, lists, sets, sorted sets with range queries and atomically incremented counters. Data can be persisted to disk and replicated to other servers for high availability. Redis is often used for caching, real-time analytics, and messaging applications due to its speed and flexibility.
10. CHAVE VALOR
user:1 name Ayrton age 23
user:2 name João phone 555-555
user:1:friends user:2 user:3 user:4 user:5
user:3 name José email xp@a.com
user:4 name Mario age 34
user:5 name Mara age 25
user:1:acess 140
user:1:token H13NDSME3MDSSR6MG6
12. KEYS
Você pesquisa pela chave.
Todas as chaves ficam na memória.
O(1)
Chaves longas, má idéia.
Chaves curtas, má idéia também.
Tente seguir um padrão.
16. APPEND key value
DECR key
DECRBY key decrement
GET key
GETBIT key offset
GETRANGE key start end
GETSET key value
INCR key
INCRBY key increment
MGET key [key ...]
MSET key value [key value ...]
MSETNX key value [key value ...]
SET key value
SETBIT key offset value
SETEX key seconds value
SETNX key value
SETRANGE key offset value
STRLEN key
20. HDEL key field [field ...]
HEXISTS key field
HGET key field
HGETALL key
HINCRBY key field increment
HKEYS key
HLEN key
HMGET key field [field ...]
HMSET key field value [field value ...]
HSET key field value
HSETNX key field value
HVALS key
Frase classica de todo slide nosql.
Esse tio ai escreveu coisas relacionadas a BD e persistência.
Turing Award in 1998 "for seminal contributions to database and transaction processing research and technical leadership in system implementation."
E desapareceu em 2007 no seu barco.
Paradigma (do grego parádeigma) literalmente modelo, é a representação de um padrão a ser seguido.
Uma característica importante do modelo chave-valor é que você pode pesquisar um dado apenas pela chave.
Esta condição obriga o programador a elaborar muito bem suas chaves.
Em contrapartida se obtém um comportamento O(1)no acesso aos dados, que na prática significa uma execução praticamente linear independente do volume de dados.
O tipo mais basico de dado no redis.
Boa opção pra mapear objetos mais complexos
Caso set index iguais ele ordenara pela string,
A cada X segundos se ao menos Y chaves forem criadas
Nome do arquivo é: dump.rdb (pode ser modificado)
Compressão usando LZF do dump para as strings