Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Redis 4
Search
Tobias Breitwieser
April 27, 2017
Technology
0
87
Redis 4
Tobias Breitwieser
April 27, 2017
Tweet
Share
More Decks by Tobias Breitwieser
See All by Tobias Breitwieser
Go - schlanke, parallele Software-Entwicklung
tarfu
0
130
Other Decks in Technology
See All in Technology
ECS_EKS以外の選択肢_ROSA入門_.pdf
masakiokuda
1
120
サラリーマンソフトウェアエンジニアのキャリア
yuheinakasaka
31
15k
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
310
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.6k
AWS re:Invent2025最新動向まとめ(NRIグループre:Cap 2025)
gamogamo
0
160
旬のブリと旬の技術で楽しむ AI エージェント設計開発レシピ
chack411
1
150
AIと融ける人間の冒険
pujisi
0
110
AI時代のアジャイルチームを目指して ー スクラムというコンフォートゾーンからの脱却 ー / Toward Agile Teams in the Age of AI
takaking22
11
5.5k
産業的変化も組織的変化も乗り越えられるチームへの成長 〜チームの変化から見出す明るい未来〜
kakehashi
PRO
1
410
Next.js 16の新機能 Cache Components について
sutetotanuki
0
220
Oracle Cloud Infrastructure:2025年12月度サービス・アップデート
oracle4engineer
PRO
0
210
re:Invent2025 セッションレポ ~Spec-driven development with Kiro~
nrinetcom
PRO
2
170
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
Paper Plane
katiecoart
PRO
0
45k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
67
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
92
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
KATA
mclloyd
PRO
33
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
180
The Language of Interfaces
destraynor
162
26k
Ruling the World: When Life Gets Gamed
codingconduct
0
120
How to train your dragon (web standard)
notwaldorf
97
6.5k
New Earth Scene 8
popppiees
0
1.3k
Transcript
Redis 4 Tobias Breitwieser
None
Was ist Redis?
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
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
Nutzt das denn jemand? GitHub, Gitlab, Uber, Trello, Instagram, OpenStack,
Patreon, Medium, Kickstarter, StackOverflow, Flickr, Airbnb, Hulu, BitBucket, Disqus, Alibaba
Ein in-memory Cache … Was soll ich jetzt damit?
Strings
Locking/Synchronisation Lock erstellen: SET lock-key verification-token EX 60 NX Lock
lösen: DEL lock-key
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
Lists
“Queue” Job hinzufügen: LPUSH queue “job payload” Job holen: RPOP
queue
Worker holt sich einen Job
Worker arbeitet
Worker stürzt ab
à
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”
Pub/Sub
Messaging Abonnieren auf Channel: SUBSCRIBE channel1 Abonnieren auf Pattern: PSUBSCRIBE
channel*
Messaging Veröffentlichen auf Channel: PUBLISH channel message
Clustering
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”
Master fällt aus
None
5m später
None
Kein Failover
None
Sentinel • Überwachung der Master • Automatischer Schwenk des Masters
• Konfigurationsverwalter für Nodes
Cluster/Sharding • Sharding • Automatische Verteilung • Jeder Master kann
mehrere Slaves haben • Auto Failover
Cluster/Sharding • Funktioniert nicht hinter einer NAT • Funktioniert nicht
im Container • Ausnahme: Docker –net=host
Redis 4
Was ist neu? • Modules • Replication 2.0 • Redis
Cluster now NAT / Docker compatible
Modules • Können eigene Befehle implementieren • Können eigene Datentypen
implementieren
Modules • Können nicht auf eigene Initiative mit Redis kommunizieren
Replication 2.0
Nächster Talk … Reaktive Programmierung für alle! Warum? Wie? <Alex
Krause/> Mai 2017 > blog.cosee.biz > talks.cosee.biz