SlideShare a Scribd company logo
1 of 58
Download to read offline
Garry Shutler | @gshutler
Garry Shutler | @gshutler
@gshutler
What is it?
@gshutler
@gshutler
What is it good for?
@gshutler
The Redis protocol
Simple to implement
Fast to parse
Human readable
@gshutler
@gshutler
The Redis protocol
COMMAND KEY ARGS...
@gshutler
@gshutler
The Redis protocol
redis.command(key, *args)
@gshutler
@gshutler
The Redis protocol
SET mykey 3
@gshutler
@gshutler
The Redis protocol
redis.set("mykey", 3)
@gshutler
@gshutler
The Redis protocol
SET mykey 3 EX 3600
@gshutler
@gshutler
The Redis protocol
redis.set("mykey", 3, { "ex": 3600 })
@gshutler
@gshutler
Cache
@gshutler
Cache
function cached(key, fn) {
var value = redis.get(key);
if (!value) {
value = fn();
redis.set(key, value);
}
return value;
}
@gshutler
Cache
function expensiveThing() {
return cached("expensive", function () {
// do something that's expensive
return expensiveValue;
});
}
@gshutler
Cache
expensiveThing(); // miss
expensiveThing(); // hit
expensiveThing(); // hit
@gshutler
Cache
function expensiveThing(param) {
var key = "expensive:" + param;
return cached(key, function () {
sleep(param);
return param;
});
}
@gshutler
Cache
expensiveThing(1); // miss
expensiveThing(1); // hit
expensiveThing(2); // miss
expensiveThing(2); // hit
expensiveThing(1); // hit
@gshutler
Cache
function cached(key, expiry, fn) {
var value = redis.get(key);
if (value) {
redis.expire(key, expiry);
} else {
value = fn();
redis.set(key, value, { "ex": expiry });
}
return value;
}
@gshutler
Cache
function expensiveThing(param) {
var key = "expensive:" + param;
return cached(key, 3600, function () {
sleep(param);
return param;
});
}
@gshutler
or
vs
Relative
In 5 minutes
Absolute
At 9am
@gshutler
Expiration
@gshutler
Expiration
my_report:last_hour
@gshutler
@gshutler
Expiration
my_report:2015051118
@gshutler
@gshutler
Data types
@gshutler
@gshutler
String
@gshutler
@gshutler
List
@gshutler
@gshutler
Set
@gshutler
@gshutler
Conditional GET
@gshutler
@gshutler
Conditional GET
var etagKey = "etag:" + url;
if (storedEtag = redis.get(etagKey)) {
headers["If-None-Match"] = storedEtag;
}
var response = http.get(url, headers);
var etag = response.headers["ETag"];
redis.set(etagKey, etag, { "ex": 300 });
@gshutler
@gshutler
Touch values
@gshutler
@gshutler
Touch values
SET {KEY} 1 EX {TIME}
EXISTS {KEY}
@gshutler
@gshutler
Ephemeral lookups
@gshutler
@gshutler
Ephemeral lookups
Forgotten password IDs
OAuth access tokens
Voucher codes
@gshutler
@gshutler
Time-series counter
@gshutler
@gshutler
Time-series counter
INCR clicks:201505111830
@gshutler
@gshutler
Time-series counter
INCR clicks:201505111830
INCR clicks:2015051118
INCR clicks:20150511
@gshutler
@gshutler
Time-series counter
INCR clicks:201505111830
EXPIRE clicks:201505111830 86400
INCR clicks:2015051118
EXPIRE clicks:2015051118 2419200
INCR clicks:20150511
@gshutler
@gshutler
Time-series counter
> MGET clicks:201505111826
clicks:201505111827
clicks:201505111828
clicks:201505111829
clicks:201505111830
1)"5"
2)(nil)
3)"2"
4)"10"
5)"1"
@gshutler
@gshutler
Unique visitors
@gshutler
@gshutler
Unique visitors
SADD {KEY} {VALUE}
@gshutler
@gshutler
Unique visitors
SADD visitors:2015051118 1
SADD visitors:2015051118 2
SADD visitors:2015051118 2
@gshutler
@gshutler
Unique visitors
SCARD {KEY}
@gshutler
@gshutler
Unique visitors
SCARD visitors:2015051118
@gshutler
@gshutler
Queuing
@gshutler
@gshutler
Queuing
RPUSH {KEY} {VALUE}
@gshutler
@gshutler
Queuing
RPUSH queue 1
RPUSH queue 2
@gshutler
@gshutler
Queuing
["1", "2"]
@gshutler
@gshutler
Queuing
LPOP {KEY}
@gshutler
@gshutler
Queuing
LPOP queue
@gshutler
@gshutler
Queuing
"1"
@gshutler
@gshutler
Queuing
["2"]
@gshutler
@gshutler
Queuing
LPUSH queue 3
@gshutler
@gshutler
Queuing
["3", "2"]
@gshutler
@gshutler
Queuing
@gshutler
RPUSH queue 4 RPUSH queue 5
queue
LPOP queue LPOP queue LPOP queue
@gshutler
Queuing
BLPOP {KEY}... {TIMEOUT}
@gshutler
@gshutler
Queuing
Encoded values
Reply queues
@gshutler
@gshutler
Have a go
@gshutler
@gshutler
Have a go
Cached Fibonacci
Distributed processing
@gshutler
Garry Shutler | @gshutler

More Related Content

Viewers also liked

License system-foss-oer-present
License system-foss-oer-presentLicense system-foss-oer-present
License system-foss-oer-presentnghia le trung
 
Prezentacija privredne komore alzasa
Prezentacija privredne komore alzasaPrezentacija privredne komore alzasa
Prezentacija privredne komore alzasaREFLESS Project
 
University of Southampton
University of SouthamptonUniversity of Southampton
University of SouthamptonREFLESS Project
 
šAuklių ir šatraminių kaimų
šAuklių ir šatraminių kaimųšAuklių ir šatraminių kaimų
šAuklių ir šatraminių kaimųJūratė Žiobienė
 
Uitdagingen van Basel III door prof. Jan Annaert
Uitdagingen van Basel III door  prof. Jan AnnaertUitdagingen van Basel III door  prof. Jan Annaert
Uitdagingen van Basel III door prof. Jan Annaertgeertcleuren
 
Produced by convert-jpg-to-pdf.net (1)
Produced by convert-jpg-to-pdf.net (1)Produced by convert-jpg-to-pdf.net (1)
Produced by convert-jpg-to-pdf.net (1)joelharvey
 
Soton centre for applied language research
Soton   centre for applied language researchSoton   centre for applied language research
Soton centre for applied language researchREFLESS Project
 
Info sec foss-mandate-migration-nov-2013-
Info sec foss-mandate-migration-nov-2013-Info sec foss-mandate-migration-nov-2013-
Info sec foss-mandate-migration-nov-2013-nghia le trung
 
REFLESS project partners: Comenius University in Bratislava
REFLESS project partners: Comenius University in BratislavaREFLESS project partners: Comenius University in Bratislava
REFLESS project partners: Comenius University in BratislavaREFLESS Project
 
REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...
REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...
REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...REFLESS Project
 
Presentation Resume (Marissa Dodd)
Presentation Resume (Marissa Dodd)Presentation Resume (Marissa Dodd)
Presentation Resume (Marissa Dodd)Marissa Dodd
 
Buiding foss-community-oct-2014
Buiding foss-community-oct-2014Buiding foss-community-oct-2014
Buiding foss-community-oct-2014nghia le trung
 

Viewers also liked (20)

Mo hinhbenvung foss
Mo hinhbenvung fossMo hinhbenvung foss
Mo hinhbenvung foss
 
License system-foss-oer-present
License system-foss-oer-presentLicense system-foss-oer-present
License system-foss-oer-present
 
FossStartUp-mar-2016
FossStartUp-mar-2016FossStartUp-mar-2016
FossStartUp-mar-2016
 
Prezentacija privredne komore alzasa
Prezentacija privredne komore alzasaPrezentacija privredne komore alzasa
Prezentacija privredne komore alzasa
 
University of Southampton
University of SouthamptonUniversity of Southampton
University of Southampton
 
как это работает
как это работаеткак это работает
как это работает
 
šAuklių ir šatraminių kaimų
šAuklių ir šatraminių kaimųšAuklių ir šatraminių kaimų
šAuklių ir šatraminių kaimų
 
Uitdagingen van Basel III door prof. Jan Annaert
Uitdagingen van Basel III door  prof. Jan AnnaertUitdagingen van Basel III door  prof. Jan Annaert
Uitdagingen van Basel III door prof. Jan Annaert
 
Produced by convert-jpg-to-pdf.net (1)
Produced by convert-jpg-to-pdf.net (1)Produced by convert-jpg-to-pdf.net (1)
Produced by convert-jpg-to-pdf.net (1)
 
Info sec nov-2014
Info sec nov-2014Info sec nov-2014
Info sec nov-2014
 
Soton centre for applied language research
Soton   centre for applied language researchSoton   centre for applied language research
Soton centre for applied language research
 
Past continuous
Past continuousPast continuous
Past continuous
 
Info sec foss-mandate-migration-nov-2013-
Info sec foss-mandate-migration-nov-2013-Info sec foss-mandate-migration-nov-2013-
Info sec foss-mandate-migration-nov-2013-
 
REFLESS project partners: Comenius University in Bratislava
REFLESS project partners: Comenius University in BratislavaREFLESS project partners: Comenius University in Bratislava
REFLESS project partners: Comenius University in Bratislava
 
WEB
WEB WEB
WEB
 
REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...
REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...
REFLESS project top-level conference: Waldemar Martyniuk, Council of Europe's...
 
Presentation Resume (Marissa Dodd)
Presentation Resume (Marissa Dodd)Presentation Resume (Marissa Dodd)
Presentation Resume (Marissa Dodd)
 
De Punta a Punta
De Punta a PuntaDe Punta a Punta
De Punta a Punta
 
Could (not)
Could (not)Could (not)
Could (not)
 
Buiding foss-community-oct-2014
Buiding foss-community-oct-2014Buiding foss-community-oct-2014
Buiding foss-community-oct-2014
 

Recently uploaded

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Redis is the answer, what's the question - Tech Nottingham

Editor's Notes

  1. REmote DIctionary Server Shared variables on the network Shared memory isn’t always bad Dealing with locks is hard, Redis does that for you Atomic operations through a single thread, fast as hell
  2. Caching and queues are regular use cases but it’s capable of much more Relevant now more than ever as microservices/SOA gains in popularity, distributed processes need ways to co-ordinate This can be done via your regular SQL database but it is churn-heavy Added load to the database is bad Store intermediary results elsewhere You will end up implementing many of Redis’ features Much better to isolate it into a separate process/service Also much superior to having an in-memory cache per machine as values only need to be cached once for the whole system, not once per server/process
  3. Going to
  4. Redis is a key-value store at heart Key can have an expiry set Value can be one of many types
  5. cached function hasn't need to change Key has to vary with parameters, namespacing is common
  6. Problem with this is it can grow infinitely, need to think about expiring data
  7. Expiry LRU cache
  8. Always set one when possible Relative is useful for "rolling windows" as demonstrated or caching "good enough" results Absolute useful for "valid until" things such as hourly or daily reports Rarely use absolute, instead build the time period into the key and set a relative expiry
  9. Namespacing of keys (again) Small overhead but good for your sanity Named keys are the exception, better to be absolute
  10. Allows for composite reports much more easily Implicitly moves last_hour forward at the boundary Can set expiry for the current hour differently in code For example current hour cache for 1 minute, past hour cache for 1 month
  11. Base value type is a string Keys are always a string Only going to cover the core ones, there's a few more specialised data types
  12. The most simple case Both the key and the value are a string Can be treated like an integer in some case which we'll cover, highly optimised operations
  13. The value is a list of strings Useful where order is important, building block for queue structures
  14. The value is a unique set of strings Useful where uniqueness is important, for example click tracking
  15. Similar to a raw cache, but about avoiding work rather than knowing work Can improve the performance High-churn so not well suited to a database If value lost not end of world
  16. Conditional GET is special case of "touch"
  17. Value doesn't really matter, the presence of key is what matters Something has been done recently or is being done so don't duplicate work Distributed locks are a special case of this, basic is usually sufficient
  18. Often need short-lived values
  19. Password Value contains user ID Expiry set to make link invalid Delete key on use to make single-use Access tokens Value contains details to look up full authorization Also expire after a time, use refresh token to get a new one Voucher codes Similar to password Could store JSON as value for more complex relationships
  20. No concept of storing an integer, but has specialised methods for treating them as such
  21. More efficient when it comes to looking things up
  22. Granularity matters for different periods of time 24 hours for minute-level 4 weeks for hour-level Forever for day level Pipelining Saves multiple round trips, perfect in this case
  23. MGET - multiple GET GET for a non-existent key (in our case never called INCR) returns nil Trivial to map this to a single int in code MGET essentially is inlined GETs so effectively unlimited, danger of multiple O(1) operations hence another reason to split to sensible granularity to reduce size of array Building block of a rate limiter, though you would probably expire more aggressively
  24. Along a similar line to the time-series counter, but with uniqueness Perfect for a Set S prefix to commands
  25. SADD deals with uniqueness on our behalf
  26. SCARD - set cardinality (count)
  27. Pipelining could be used to get multiple SCARDs like MGET MGETs just a more common case so has a special command
  28. Lists Key is name of list, value is a string
  29. Returns nil if list empty
  30. Returns nil if list empty
  31. Prioritisation
  32. More efficient to wait for work Should always have a timeout (seconds) Can know the process is alive if nothing else
  33. JSON Can expire complex data structures too
  34. Cached Fibonacci Distributed processing - workers could simple print - Could send an email or text message Possibly respond to sending process via response queue