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

Redis 4

Redis 4

Tobias Breitwieser

April 27, 2017
Tweet

More Decks by Tobias Breitwieser

Other Decks in Technology

Transcript

  1. Was ist Redis? • Memcache like in-memory key/value store •

    Persistierung auf Festplatte • Datentypen • Strings • Lists • Sets • Sorted Sets • Hash Tables • Pub/Sub Topics • Atomare Operationen • TTL für Keys • LUA scripting
  2. Bestimmt schwer zu betreiben… Server: docker run --name some-redis -d

    -p 6379:6379 redis CLI Client: docker run -it --rm redis redis-cli -h redis -p 6379 CLI Client with link: docker run -it --link some-redis:redis --rm redis redis-cli -h redis -p 6379
  3. Nutzt das denn jemand? GitHub, Gitlab, Uber, Trello, Instagram, OpenStack,

    Patreon, Medium, Kickstarter, StackOverflow, Flickr, Airbnb, Hulu, BitBucket, Disqus, Alibaba
  4. Locking/Synchronisation Lock erstellen: SET lock-key verification-token EX 60 NX Lock

    mit LUA: if redis.call("get",KEYS[1]) == ARGV[1] then return redis.call("del",KEYS[1]) else return 0 end EVAL <script> 1 lock-key verification-token
  5. à

  6. Reliable Queue Job hinzufügen: LPUSH queue “job payload” Job holen:

    RPOPLPUSH queue inworkqueue Job aus der working queue entfernen: LREM inworkqueue 1 “job payload”
  7. Master/Slave Replikation ist einfach: “SLAVEOF host port” Passwort für Master

    auf Slave: “config set masterauth mypass” Passwort auf Master: “config set requirepass mypass”
  8. Was ist neu? • Modules • Replication 2.0 • Redis

    Cluster now NAT / Docker compatible
  9. Nächster Talk … Reaktive Programmierung für alle! Warum? Wie? <Alex

    Krause/> Mai 2017 > blog.cosee.biz > talks.cosee.biz