Qual é a forma mais
rápida e barata de
processar algo❓🤔
É não processar❗️
Cache
Escala horizontal
Como fica o cache?
Principalmente em sistema de fazem login pro
session
Ainda não conseguimos
compartilhar memória entre
servidores
Cache Distribuído
Estratégias de escrita Cache
Pre-caching data
On-demand
Read strategy - Cache Aside
Write Strategy - Write Around
Write Strategy - Write Through
Write Strategy - Write Back
Estratégias para invalidar
Cache
Verificação programada
Expiração de forma ativa
Expiração por tempo - TTl
E o tal do Redis?
REmote DIctionary Server
Redis
The open source, in-memory data store used by
millions of developers as a database, cache,
streaming engine, and message broker.
Redis
Banco de dados Open Sourse
NoSQL
Chave valor
In-memory
Single-threaded
Chave valor
Pontos de atenção
Reiniciou, perdeu os dados, até da para fazer
armazenamento no disco, mas…
Pontos de atenção
Usos
Distributed Cache
Distributed Lock
Feature Toggle
Sessoes
…
Estruturas de dados
Temos algumas formas de organizar nossas
iformações
String
Nome das chaves
objeto:identificador:campo
Nome das chaves
TTL - Tempo de Vida
Parâmetros do expire
NX -- Set expiry only when the key has no expiry
XX -- Set expiry only when the key has an existing expiry
GT -- Set expiry only when the new expiry is greater than current
LT -- Set expiry only when the new expiry is less than current on
String
Lista
Sets
Sorted Sets
Hash
Redis e Estratégias Cache Distribuído

Redis e Estratégias Cache Distribuído