Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Redis: du cache à la time series!

Redis: du cache à la time series!

Redis est devenu extrêmement populaire. Redis est souvent utilisé comme solution de cache ou pour stocker les sessions utilisateurs. Mais Redis a beaucoup d’autres fonctionnalités et devient le couteau suisse des applications Cloud. En effet, Redis peut être utilisé comme base de données spatiales, queue d’exécution, time series, moteur de recherche. On peut stocker des documents textes, binaires ou du JSON, des graphes et même des structures mathématiques tel que des filtres Bloom ou Cuckoo.

Cette présentation explique les différents types de données que Redis peut manipuler et comment l’API Redis intégré à Quarkus vous permet de développer avec ces types facilement, et rapidement. Après cette présentation, vous ne verrez plus votre Redis comme avant!

Holly Cummins

April 12, 2023
Tweet

More Decks by Holly Cummins

Other Decks in Programming

Transcript

  1. Redis du cache à la time series! Clement Escoffier Distinguished

    Engineer Red Hat @clementplop Holly Cummins Sr. Principal Software Engineer Red Hat @holly_cummins
  2. Redis is a distributed key/value store key:1 key:2 key:3 key:4

    key:5 Value 1 Value 2 Value 3 Value 4 Value 5 App.
  3. Redis as a cache Application Redis >> GET my-cache >>

    SET my-cache value EX 60 null << OK << var value = cache.get("my-cache"); if (value == null) { value = compute(); cache.set("my-cache", value, Duration.ofSecond(60)); } return value; Application Redis >> GET my-cache Value <<
  4. 389+ Commands k e y s z s c o

    r e d e c r t s . g e t c f . i n s e r t h d e l m g e t timeseries.REFRESHCLUSTER FT.ALTER touch xpending bf.info monitor bf.card lrem json.numincrby tdigest.revrank fcall lmpop xreadgroup cms.initbyprob timeseries.CLUSTERSETFROMSHARD pexpire FT.DROP ts.del pfcount auth cf.info ts.create bgrewriteaof xadd json.del timeseries.INNERCOMMUNICATION graph.DELETE sdiffstore zrandmember bf.insert reset xlen zinterstore json.clear readwrite topk.info json.nummultby xtrim json.arrinsert topk.list cms.merge flushdb ts.createrule json.type replicaof role pexpiretime pfadd echo tdigest.rank swapdb json.objkeys pfmerge psubscribe hset graph.SLOWLOG FT._ALIASDELIFX incrby info ttl timeseries.INFOCLUSTER bitfield_ro time hrandfield discard module zinter json.set georadius_ro zpopmin subscribe move cf.insertnx FT.DEBUG zscan zrank FT._CREATEIFNX bf.reserve json.arrtrim asking sintercard graph.QUERY FT.SAFEADD json.objlen FT.SEARCH hsetnx flushall bitcount hget FT.AGGREGATE get sdiff strlen ts.mrevrange sort tdigest.merge incrbyfloat hscan srem graph.DEBUG sunionstore exec eval_ro spublish migrate spop psetex timeseries.CLUSTERSET cms.initbydim ts.decrby linsert sadd hmget setrange ssubscribe readonly cluster zmscore zrevrank lolwut hstrlen tdigest.add json.numpowby llen json.debug georadius function bf.exists FT.CONFIG FT.DICTDUMP lpop FT.ALIASDEL topk.query smembers zdiffstore zrangestore zunion debug restore json.arrappend zcount lpushx pexpireat timeseries.HELLO json.toggle FT.SYNDUMP zremrangebylex zlexcount config bitop FT.ALIASUPDATE FT.SPELLCHECK zrevrangebylex json.strappend tdigest.info cf.addnx bzmpop rename setex FT.SYNADD ts.info lpush latency ts.mget eval randomkey xsetid FT.SUGLEN wait cms.query xrange lastsave dbsize bzpopmax zrem setnx pfselftest hvals getrange bzpopmin lmove json.forget exists ts.alter zintercard acl msetnx del xautoclaim watch graph.PROFILE bf.loadchunk ts.madd lindex select quit lcs setbit tdigest.trimmed_mean shutdown blmove cf.del copy brpoplpush evalsha_ro json.arrlen rpush smismember cf.compact zremrangebyrank ts.range zremrangebyscore incr FT.SUGADD FT.GET pubsub FT.SUGDEL tdigest.max evalsha cf.count zpopmax tdigest.byrank hexists geopos FT.CURSOR zrevrangebyscore smove FT._DROPINDEXIFX graph.LIST georadiusbymember_ro cf.loadchunk cf.add slowlog bf.mexists FT.ALIASADD FT.TAGVALS memory lset object getbit xinfo sync sscan topk.count psync sinterstore scan client cf.scandump multi cf.exists json.resp getset rpoplpush bitfield dump FT.CREATE sismember getex cms.info restore-asking lrange command timeseries.NETWORKTEST zcard FT.SYNUPDATE punsubscribe blpop graph.RO_QUERY tdigest.min sunion geoadd zincrby zadd FT.PROFILE pttl scard getdel zrangebyscore geosearchstore blmpop srandmember failover cf.mexists
  5. Generic Transaction Hash Geospatial Set Sorted Set String List Stream

    Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series 20+ Command Groups Generic Transaction H ash Geospatial Set Sorted Set String List Stream Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series
  6. Generic Transaction Hash Geospatial Set Sorted Set String List Stream

    Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series probabilistic 
 data structures Generic Transaction H ash Geospatial Set Sorted Set String List Stream Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series
  7. Generic Transaction Hash Geospatial Set Sorted Set String List Stream

    Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series Generic Transaction H ash Geospatial Set Sorted Set String List Stream Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series Redis Stack Redis Core
  8. Generic Transaction Hash Geospatial Set Sorted Set String List Stream

    Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series Generic Transaction H ash Geospatial Set Sorted Set String List Stream Pub/Sub BitMap HyperLogLog Bloom Cuckoo Count-M in Top-K T-Digest Graph JSON Search Auto-Suggest Time Series Shown Today
  9. Wednesday 13:30 16:30 Kubernetes, dépassionné et pour les ultra débutants

    (Sun & Sebi & Horacio) Wednesday 18:30 19:00: JKube remote-dev : coder avec tous vos micro-services du cloud ... en local ! (Sun) Thursday 15:30 18:30: Enter Serverless Functions Journey with Quarkus (Daniel) Friday 11:45 12:30 Writing Greener Java Applications (Holly) Friday 14:30 15:15: 1, 2, 3 Quarkus! (Clement & Aurea) Want to see/watch more?