SlideShare a Scribd company logo
INTRODUCTION REDIS
Maarten Smeets
09-04-2018
INTRODUCTION REDIS
INTRODUCING REDIS DATATYPES PUBLISH SUBSCRIBE
PERSISTENCE TRANSACTIONS
REJSON AND REDISEARCH CLIENTS
1 2 3
What is Redis Why use Redis Who uses Redis
INTRODUCTION REDIS
INTRODUCING REDIS
• Redis
First release 2009
An open-source in-memory database project implementing
a distributed, in-memory key-value store with optional
durability.
INTRODUCING REDIS
• Redis is an open source, in-memory data structure store
Can be used as Database, Cache, Message broker
• NoSQL Key/Value store
• Supports multiple data structures
• Features like
• Transactions
• Pub/Sub
• Scalability / availability options
• Time to live for entries Mostly single threaded!
Modules can be multi threaded
TYPICAL USES OF REDIS
• Cache database query results
• https://redislabs.com/ebook/part-1-getting-started/chapter-2-anatomy-of-a-redis-web-application/2-4-
database-row-caching/
• Cache entire webpages (e.g. Wordpress)
• https://wordpress.org/plugins/redis-cache/
• Use for HTTP session store
• https://docs.spring.io/spring-session/docs/current/reference/html5/
• Cache logins / cookies
• https://redislabs.com/ebook/part-1-getting-started/chapter-2-anatomy-of-a-redis-web-application/2-1-
login-and-cookie-caching/
WHY REDIS?
• Very flexible
• Very fast
• Caching & Disk persistence
• No schemas, column names
• Rich Datatype Support
HOW TO USE REDIS
EXAMPLE: CACHE DB RESULTS
Clients Back-end / server side
Persistent storage
Cache
WHO USES REDIS
Azure Redis Cache
WHO USES REDIS
IN THE NETHERLANDS
1 2 3
Strings and expiry Lists, Sets, Hashes Sorted sets
DATATYPES
DATATYPES
• Strings
• Lists
• Sets
• Sorted sets
• Hashes
• Bitmaps
• Hyperlogs
• Geospatial
indexes
Datatypes cannot be nested!
E.g. no lists of hashes
You can name your variables like:
person:1
person:2
KEYS person:* gives all person variables
The KEYS command is blocking.
Better to keep a set or list of person keys
STRINGS
• Max size 512Mb
• Byte save. Can store binaries
• Use cases:
• Store JPEG’s
• Store serialized objects
• Example usage
127.0.0.1:6379> SET greeting
‘Hello’
OK
127.0.0.1:6379> GET greeting
“Hello”
127.0.0.1:6379> DEL greeting
(integer) 1
127.0.0.1:6379> EXISTS greeting
(integer) 0
EXPIRY
• Expiry can be set for existing variables
127.0.0.1:6379> SET greeting “Hello”
OK
127.0.0.1:6379> EXPIRE greeting 10
(integer) 1
127.0.0.1:6379> TTL greeting
(integer) 8
127.0.0.1:6379> GET greeting
“Hello”
127.0.0.1:6379> GET greeting
(nil)
EXPIRY
• Expiry can be set when a variable is created and expiry can be removed
127.0.0.1:6379> SETEX greeting 10 “Hello”
OK
127.0.0.1:6379> TTL greeting
(integer) 8
127.0.0.1:6379> PERSIST greeting
OK
127.0.0.1:6379> TTL greeting
(integer) -1
LISTS
• A list of Strings
• Max size 4294967295
• Can for example be used for
• timelines of social networks
• Speed
• Actions at the start or end of the list are very fast.
• Actions in the middle are a little less fast
127.0.0.1:6379> LPUSH people “Maarten”
(integer) 1
127.0.0.1:6379> RPUSH people “John”
(integer) 2
127.0.0.1:6379> LRANGE people 0 -1
1) “Maarten”
2) “John”
127.0.0.1:6379> LLEN people
(integer) 2
127.0.0.1:6379> LPOP people
“Maarten”
127.0.0.1:6379> RPOP people
“John”
SETS
• Unordered collection of Strings
• Does not allow repeated elements
• Useful for tracking unique items
• Allows extracting random members
Using SPOP, SRANDMEMBER
• Useful for intersects and diffs
127.0.0.1:6379> SADD cars “Honda”
(integer) 1
127.0.0.1:6379> SADD cars “Ford”
(integer) 1
127.0.0.1:6379> SADD cars “Honda”
(integer) 0
127.0.0.1:6379> SISMEMBER cars “Honda”
(integer) 1
127.0.0.1:6379> SISMEMBER cars “BMW”
(integer) 0
127.0.0.1:6379> SMEMBERS cars
1) “Ford”
2) “Honda”
127.0.0.1:6379> SMOVE cars mycars “Honda”
(integer) 1
127.0.0.1:6379> SDIFF cars mycars
1) “Ford”
HASHES
• Maps between string fields and values
• Ideal for storing objects
127.0.0.1:6379> HMSET user:1000 username antirez
password P1pp0 age 34
OK
127.0.0.1:6379> HGETALL user:1000
1) “username”
2) “antirez”
3) “password”
4) “P1pp0”
5) “age”
6) “34”
127.0.0.1:6379> HSET user:1000 password 12345
(integer) 0
127.0.0.1:6379> HGET user:1000 password
“12345”
127.0.0.1:6379> HKEYS user:1000
1) “username”
2) “password”
3) “age”
SORTED SETS
• Non repeating collections of Strings
• Every member has a score.
• Members are unique. Scores are not
• Ordering is from small to large score
• Ordering for items with the same score is
alphabetic
• Useful for leader boards or autocomplete
127.0.0.1:6379> ZADD myzset 1 "one"
(integer) 1
127.0.0.1:6379> ZADD myzset 1 "one"
(integer) 0
127.0.0.1:6379> ZADD myzset 1 "uno"
(integer) 1
127.0.0.1:6379> ZADD myzset 2 "two" 3 "three"
(integer) 2
127.0.0.1:6379> ZRANGE myzset 0 -1 WITHSCORES
1) "one"
2) "1"
3) "uno"
4) "1"
5) "two"
6) "2"
7) "three"
8) "3"
127.0.0.1:6379> ZRANGE myzset 0 0
1) "one"
1 2
PERSISTENCE
Redis Database File (RDB) Append Only File (OAF)
PERSISTENCE
RDB (Redis Database File) AOF (Append Only File)
Provides point in time snapshots Logs every write
Creates complete snapshot at specified interval
Replays at server startup.
If log gets big, optimization takes place
File is in binary format File is easily readable
On crash minutes of data can be lost Minimal chance of data loss
Small files, fast (mostly) Big files, ‘slow’
https://www.slideshare.net/eugef/redis-persistence-in-practice-1
1 2
PUBLISH SUBSCRIBE
How to use it Things to mind
PUBLISH SUBSCRIBE
HOW DOES IT WORK
• SUBSCRIBE [channel]
• UNSUBSCRIBE [channel]
• PUBLISH [channel] [message]
Channel can contain
glob patterns like news.*
PUBLISH SUBSCRIBE
THINGS TO MIND
• A missed message has been missed permanently.
No retry
• There is no history of messages
Like a JMS topic without durable subscribers
1 2
TRANSACTIONS
TRANSACTIONS
• Not like relational database transactions!
• Start a transaction: MULTI
Commands after MULTI are queued
• Execute the queued commands: EXEC
All or none of the commands are executed
However, if one fails, the others are still executed
• Make EXEC conditional: WATCH
EXEC will only execute if watched variables are unchanged
WATCH zset
element = ZRANGE zset 0 0
MULTI
ZREM zset element
EXEC
There is no ZPOP but
it can be implemented like below
Redis LUA scripts are also
executed in a transaction
1 2
JSON AND SEARCH
ReJSON RediSearch
REDIS AS A JSON STORE
JSON support can be implemented by adding the ReJSON module from Redis Labs
127.0.0.1:6379> JSON.SET scalar . '"Hello JSON!"'
OK
127.0.0.1:6379> JSON.SET object . '{"foo": "bar", "ans": 42}'
OK
127.0.0.1:6379> JSON.GET object
"{"foo":"bar","ans":42}"
127.0.0.1:6379> JSON.GET object .ans
"42"
https://redislabs.com/blog/redis-as-a-json-store/
REDISEARCH - REDIS POWERED SEARCH ENGINE
Auto completion
127.0.0.1:6379> FT.SUGADD autocomplete “hello world” 100
OK
127.0.0.1:6379> FT.SUGGET autocomplete “he”
1) "hello world“
Full text search
127.0.0.1:6379> FT.ADD myIdx doc1 1.0 FIELDS title “hello” body “bla” url “http://redis.io”
OK
127.0.0.1:6379> FT.SEARCH myIdx “hello world” LIMIT 0 10
1) (integer) 1
2) “doc1”
3) 1) “title”
2) “hello”
3) “body”
4) “bla”
5) "url”
6) “http://redis.io”
http://redisearch.io/Quick_Start/
docker run -p 6379:6379 redislabs/redisearch:latest
1 2
CLIENTS
Node.js Spring Boot
CLIENTS
NODE.JS
Create a client and connect
Create an event handler
Subscribe to a channel
CLIENTS
SPRING BOOT
• There is no annotation available to
• Create a container
• Register a listener to the container
• Register a receiver to the listener
• This requires more code than for example listening to a Kafka topic
https://spring.io/guides/gs/messaging-redis/
CLIENTS
SPRING BOOT
Wait for a single message
CLIENTS
SPRING BOOT
SOME THINGS TO MIND IN PRODUCTION
• Redis is single threaded
• Want to use more CPU’s? Use more Redis instances!
• Requests are blocking. Be careful with for example KEYS commands. Mind
the time complexity of operations!
• Mind the number of connections!
• Implement a proxy, for example twemproxy (manages persistent connections)
• Snapshotting is blocking
• Investigate persistence requirements and consider rolling BGSAVE, OAF
instead of snapshotting
http://tech.trivago.com/2017/01/25/learn-redis-the-hard-way-in-production/
Introduction to Redis
Ad

More Related Content

What's hot (20)

Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with Redis
George Platon
 
redis basics
redis basicsredis basics
redis basics
Manoj Kumar
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL database
Ali MasudianPour
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
NexThoughts Technologies
 
A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redis
Zhichao Liang
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
TO THE NEW | Technology
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교
Woo Yeong Choi
 
Redis Introduction
Redis IntroductionRedis Introduction
Redis Introduction
Alex Su
 
Redis and it's data types
Redis and it's data typesRedis and it's data types
Redis and it's data types
Aniruddha Chakrabarti
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
Bishal Khanal
 
An Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfAn Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdf
Stephen Lorello
 
MongoDB
MongoDBMongoDB
MongoDB
nikhil2807
 
Redis
RedisRedis
Redis
imalik8088
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
Derek Stainer
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
MongoDB
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
Pooyan Mehrparvar
 
Redis data modeling examples
Redis data modeling examplesRedis data modeling examples
Redis data modeling examples
Terry Cho
 
An Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDBAn Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDB
MongoDB
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
Saurav Haloi
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with Redis
George Platon
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL database
Ali MasudianPour
 
A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redis
Zhichao Liang
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교
Woo Yeong Choi
 
Redis Introduction
Redis IntroductionRedis Introduction
Redis Introduction
Alex Su
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
Bishal Khanal
 
An Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfAn Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdf
Stephen Lorello
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
Derek Stainer
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
MongoDB
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
Pooyan Mehrparvar
 
Redis data modeling examples
Redis data modeling examplesRedis data modeling examples
Redis data modeling examples
Terry Cho
 
An Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDBAn Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDB
MongoDB
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
Saurav Haloi
 

Similar to Introduction to Redis (20)

10 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 201910 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
Dave Nielsen
 
10 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 201910 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 2019
Dave Nielsen
 
Resilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron Evans
Resilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron EvansResilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron Evans
Resilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron Evans
Redis Labs
 
Testing at scale with redis queues
Testing at scale with redis queuesTesting at scale with redis queues
Testing at scale with redis queues
AAron EvaNS
 
Testing at scale with Redis queues
Testing at scale with Redis queuesTesting at scale with Redis queues
Testing at scale with Redis queues
AAron EvaNS
 
WebClusters, Redis
WebClusters, RedisWebClusters, Redis
WebClusters, Redis
Filip Tepper
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
Michael Renner
 
Boosting Machine Learning with Redis Modules and Spark
Boosting Machine Learning with Redis Modules and SparkBoosting Machine Learning with Redis Modules and Spark
Boosting Machine Learning with Redis Modules and Spark
Dvir Volk
 
Spark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir VolkSpark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Itamar Haber
 
Redis modules 101
Redis modules 101Redis modules 101
Redis modules 101
Dvir Volk
 
Redispresentation apac2012
Redispresentation apac2012Redispresentation apac2012
Redispresentation apac2012
Ankur Gupta
 
Getting Started with Redis
Getting Started with RedisGetting Started with Redis
Getting Started with Redis
Faisal Akber
 
Seedhack MongoDB 2011
Seedhack MongoDB 2011Seedhack MongoDB 2011
Seedhack MongoDB 2011
Rainforest QA
 
Redis Functions, Data Structures for Web Scale Apps
Redis Functions, Data Structures for Web Scale AppsRedis Functions, Data Structures for Web Scale Apps
Redis Functions, Data Structures for Web Scale Apps
Dave Nielsen
 
Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017
HashedIn Technologies
 
London MongoDB User Group April 2011
London MongoDB User Group April 2011London MongoDB User Group April 2011
London MongoDB User Group April 2011
Rainforest QA
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis Labs
Redis Labs
 
Redis
RedisRedis
Redis
Rajesh Kumar
 
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 201910 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
Dave Nielsen
 
10 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 201910 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 2019
Dave Nielsen
 
Resilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron Evans
Resilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron EvansResilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron Evans
Resilient Testing At Scale Using Redis Queues To Manage Concurrency: Aaron Evans
Redis Labs
 
Testing at scale with redis queues
Testing at scale with redis queuesTesting at scale with redis queues
Testing at scale with redis queues
AAron EvaNS
 
Testing at scale with Redis queues
Testing at scale with Redis queuesTesting at scale with Redis queues
Testing at scale with Redis queues
AAron EvaNS
 
WebClusters, Redis
WebClusters, RedisWebClusters, Redis
WebClusters, Redis
Filip Tepper
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
Michael Renner
 
Boosting Machine Learning with Redis Modules and Spark
Boosting Machine Learning with Redis Modules and SparkBoosting Machine Learning with Redis Modules and Spark
Boosting Machine Learning with Redis Modules and Spark
Dvir Volk
 
Spark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir VolkSpark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Itamar Haber
 
Redis modules 101
Redis modules 101Redis modules 101
Redis modules 101
Dvir Volk
 
Redispresentation apac2012
Redispresentation apac2012Redispresentation apac2012
Redispresentation apac2012
Ankur Gupta
 
Getting Started with Redis
Getting Started with RedisGetting Started with Redis
Getting Started with Redis
Faisal Akber
 
Seedhack MongoDB 2011
Seedhack MongoDB 2011Seedhack MongoDB 2011
Seedhack MongoDB 2011
Rainforest QA
 
Redis Functions, Data Structures for Web Scale Apps
Redis Functions, Data Structures for Web Scale AppsRedis Functions, Data Structures for Web Scale Apps
Redis Functions, Data Structures for Web Scale Apps
Dave Nielsen
 
Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017
HashedIn Technologies
 
London MongoDB User Group April 2011
London MongoDB User Group April 2011London MongoDB User Group April 2011
London MongoDB User Group April 2011
Rainforest QA
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis Labs
Redis Labs
 
Ad

More from Maarten Smeets (16)

Google jib: Building Java containers without Docker
Google jib: Building Java containers without DockerGoogle jib: Building Java containers without Docker
Google jib: Building Java containers without Docker
Maarten Smeets
 
Introduction to Anchore Engine
Introduction to Anchore EngineIntroduction to Anchore Engine
Introduction to Anchore Engine
Maarten Smeets
 
R2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database ConnectivityR2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database Connectivity
Maarten Smeets
 
Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!
Maarten Smeets
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
Maarten Smeets
 
Performance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMsPerformance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMs
Maarten Smeets
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
Maarten Smeets
 
Microservices on Application Container Cloud Service
Microservices on Application Container Cloud ServiceMicroservices on Application Container Cloud Service
Microservices on Application Container Cloud Service
Maarten Smeets
 
WebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck ThreadsWebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck Threads
Maarten Smeets
 
All you need to know about transport layer security
All you need to know about transport layer securityAll you need to know about transport layer security
All you need to know about transport layer security
Maarten Smeets
 
Webservice security considerations and measures
Webservice security considerations and measuresWebservice security considerations and measures
Webservice security considerations and measures
Maarten Smeets
 
Machine learning with R
Machine learning with RMachine learning with R
Machine learning with R
Maarten Smeets
 
WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!
Maarten Smeets
 
Oracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new featuresOracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new features
Maarten Smeets
 
How to build a cloud adapter
How to build a cloud adapterHow to build a cloud adapter
How to build a cloud adapter
Maarten Smeets
 
WebLogic authentication debugging
WebLogic authentication debuggingWebLogic authentication debugging
WebLogic authentication debugging
Maarten Smeets
 
Google jib: Building Java containers without Docker
Google jib: Building Java containers without DockerGoogle jib: Building Java containers without Docker
Google jib: Building Java containers without Docker
Maarten Smeets
 
Introduction to Anchore Engine
Introduction to Anchore EngineIntroduction to Anchore Engine
Introduction to Anchore Engine
Maarten Smeets
 
R2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database ConnectivityR2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database Connectivity
Maarten Smeets
 
Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!Performance Issue? Machine Learning to the rescue!
Performance Issue? Machine Learning to the rescue!
Maarten Smeets
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
Maarten Smeets
 
Performance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMsPerformance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMs
Maarten Smeets
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
Maarten Smeets
 
Microservices on Application Container Cloud Service
Microservices on Application Container Cloud ServiceMicroservices on Application Container Cloud Service
Microservices on Application Container Cloud Service
Maarten Smeets
 
WebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck ThreadsWebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck Threads
Maarten Smeets
 
All you need to know about transport layer security
All you need to know about transport layer securityAll you need to know about transport layer security
All you need to know about transport layer security
Maarten Smeets
 
Webservice security considerations and measures
Webservice security considerations and measuresWebservice security considerations and measures
Webservice security considerations and measures
Maarten Smeets
 
Machine learning with R
Machine learning with RMachine learning with R
Machine learning with R
Maarten Smeets
 
WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!
Maarten Smeets
 
Oracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new featuresOracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new features
Maarten Smeets
 
How to build a cloud adapter
How to build a cloud adapterHow to build a cloud adapter
How to build a cloud adapter
Maarten Smeets
 
WebLogic authentication debugging
WebLogic authentication debuggingWebLogic authentication debugging
WebLogic authentication debugging
Maarten Smeets
 
Ad

Recently uploaded (20)

Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key  With LatestAdobe Photoshop CC 2025 Crack Full Serial Key  With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
usmanhidray
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Adobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install IllustratorAdobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install Illustrator
usmanhidray
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key  With LatestAdobe Photoshop CC 2025 Crack Full Serial Key  With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
usmanhidray
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Adobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install IllustratorAdobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install Illustrator
usmanhidray
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 

Introduction to Redis

  • 2. INTRODUCTION REDIS INTRODUCING REDIS DATATYPES PUBLISH SUBSCRIBE PERSISTENCE TRANSACTIONS REJSON AND REDISEARCH CLIENTS
  • 3. 1 2 3 What is Redis Why use Redis Who uses Redis INTRODUCTION REDIS
  • 4. INTRODUCING REDIS • Redis First release 2009 An open-source in-memory database project implementing a distributed, in-memory key-value store with optional durability.
  • 5. INTRODUCING REDIS • Redis is an open source, in-memory data structure store Can be used as Database, Cache, Message broker • NoSQL Key/Value store • Supports multiple data structures • Features like • Transactions • Pub/Sub • Scalability / availability options • Time to live for entries Mostly single threaded! Modules can be multi threaded
  • 6. TYPICAL USES OF REDIS • Cache database query results • https://redislabs.com/ebook/part-1-getting-started/chapter-2-anatomy-of-a-redis-web-application/2-4- database-row-caching/ • Cache entire webpages (e.g. Wordpress) • https://wordpress.org/plugins/redis-cache/ • Use for HTTP session store • https://docs.spring.io/spring-session/docs/current/reference/html5/ • Cache logins / cookies • https://redislabs.com/ebook/part-1-getting-started/chapter-2-anatomy-of-a-redis-web-application/2-1- login-and-cookie-caching/
  • 7. WHY REDIS? • Very flexible • Very fast • Caching & Disk persistence • No schemas, column names • Rich Datatype Support
  • 8. HOW TO USE REDIS EXAMPLE: CACHE DB RESULTS Clients Back-end / server side Persistent storage Cache
  • 9. WHO USES REDIS Azure Redis Cache
  • 10. WHO USES REDIS IN THE NETHERLANDS
  • 11. 1 2 3 Strings and expiry Lists, Sets, Hashes Sorted sets DATATYPES
  • 12. DATATYPES • Strings • Lists • Sets • Sorted sets • Hashes • Bitmaps • Hyperlogs • Geospatial indexes Datatypes cannot be nested! E.g. no lists of hashes You can name your variables like: person:1 person:2 KEYS person:* gives all person variables The KEYS command is blocking. Better to keep a set or list of person keys
  • 13. STRINGS • Max size 512Mb • Byte save. Can store binaries • Use cases: • Store JPEG’s • Store serialized objects • Example usage 127.0.0.1:6379> SET greeting ‘Hello’ OK 127.0.0.1:6379> GET greeting “Hello” 127.0.0.1:6379> DEL greeting (integer) 1 127.0.0.1:6379> EXISTS greeting (integer) 0
  • 14. EXPIRY • Expiry can be set for existing variables 127.0.0.1:6379> SET greeting “Hello” OK 127.0.0.1:6379> EXPIRE greeting 10 (integer) 1 127.0.0.1:6379> TTL greeting (integer) 8 127.0.0.1:6379> GET greeting “Hello” 127.0.0.1:6379> GET greeting (nil)
  • 15. EXPIRY • Expiry can be set when a variable is created and expiry can be removed 127.0.0.1:6379> SETEX greeting 10 “Hello” OK 127.0.0.1:6379> TTL greeting (integer) 8 127.0.0.1:6379> PERSIST greeting OK 127.0.0.1:6379> TTL greeting (integer) -1
  • 16. LISTS • A list of Strings • Max size 4294967295 • Can for example be used for • timelines of social networks • Speed • Actions at the start or end of the list are very fast. • Actions in the middle are a little less fast 127.0.0.1:6379> LPUSH people “Maarten” (integer) 1 127.0.0.1:6379> RPUSH people “John” (integer) 2 127.0.0.1:6379> LRANGE people 0 -1 1) “Maarten” 2) “John” 127.0.0.1:6379> LLEN people (integer) 2 127.0.0.1:6379> LPOP people “Maarten” 127.0.0.1:6379> RPOP people “John”
  • 17. SETS • Unordered collection of Strings • Does not allow repeated elements • Useful for tracking unique items • Allows extracting random members Using SPOP, SRANDMEMBER • Useful for intersects and diffs 127.0.0.1:6379> SADD cars “Honda” (integer) 1 127.0.0.1:6379> SADD cars “Ford” (integer) 1 127.0.0.1:6379> SADD cars “Honda” (integer) 0 127.0.0.1:6379> SISMEMBER cars “Honda” (integer) 1 127.0.0.1:6379> SISMEMBER cars “BMW” (integer) 0 127.0.0.1:6379> SMEMBERS cars 1) “Ford” 2) “Honda” 127.0.0.1:6379> SMOVE cars mycars “Honda” (integer) 1 127.0.0.1:6379> SDIFF cars mycars 1) “Ford”
  • 18. HASHES • Maps between string fields and values • Ideal for storing objects 127.0.0.1:6379> HMSET user:1000 username antirez password P1pp0 age 34 OK 127.0.0.1:6379> HGETALL user:1000 1) “username” 2) “antirez” 3) “password” 4) “P1pp0” 5) “age” 6) “34” 127.0.0.1:6379> HSET user:1000 password 12345 (integer) 0 127.0.0.1:6379> HGET user:1000 password “12345” 127.0.0.1:6379> HKEYS user:1000 1) “username” 2) “password” 3) “age”
  • 19. SORTED SETS • Non repeating collections of Strings • Every member has a score. • Members are unique. Scores are not • Ordering is from small to large score • Ordering for items with the same score is alphabetic • Useful for leader boards or autocomplete 127.0.0.1:6379> ZADD myzset 1 "one" (integer) 1 127.0.0.1:6379> ZADD myzset 1 "one" (integer) 0 127.0.0.1:6379> ZADD myzset 1 "uno" (integer) 1 127.0.0.1:6379> ZADD myzset 2 "two" 3 "three" (integer) 2 127.0.0.1:6379> ZRANGE myzset 0 -1 WITHSCORES 1) "one" 2) "1" 3) "uno" 4) "1" 5) "two" 6) "2" 7) "three" 8) "3" 127.0.0.1:6379> ZRANGE myzset 0 0 1) "one"
  • 20. 1 2 PERSISTENCE Redis Database File (RDB) Append Only File (OAF)
  • 21. PERSISTENCE RDB (Redis Database File) AOF (Append Only File) Provides point in time snapshots Logs every write Creates complete snapshot at specified interval Replays at server startup. If log gets big, optimization takes place File is in binary format File is easily readable On crash minutes of data can be lost Minimal chance of data loss Small files, fast (mostly) Big files, ‘slow’ https://www.slideshare.net/eugef/redis-persistence-in-practice-1
  • 22. 1 2 PUBLISH SUBSCRIBE How to use it Things to mind
  • 23. PUBLISH SUBSCRIBE HOW DOES IT WORK • SUBSCRIBE [channel] • UNSUBSCRIBE [channel] • PUBLISH [channel] [message] Channel can contain glob patterns like news.*
  • 24. PUBLISH SUBSCRIBE THINGS TO MIND • A missed message has been missed permanently. No retry • There is no history of messages Like a JMS topic without durable subscribers
  • 26. TRANSACTIONS • Not like relational database transactions! • Start a transaction: MULTI Commands after MULTI are queued • Execute the queued commands: EXEC All or none of the commands are executed However, if one fails, the others are still executed • Make EXEC conditional: WATCH EXEC will only execute if watched variables are unchanged WATCH zset element = ZRANGE zset 0 0 MULTI ZREM zset element EXEC There is no ZPOP but it can be implemented like below Redis LUA scripts are also executed in a transaction
  • 27. 1 2 JSON AND SEARCH ReJSON RediSearch
  • 28. REDIS AS A JSON STORE JSON support can be implemented by adding the ReJSON module from Redis Labs 127.0.0.1:6379> JSON.SET scalar . '"Hello JSON!"' OK 127.0.0.1:6379> JSON.SET object . '{"foo": "bar", "ans": 42}' OK 127.0.0.1:6379> JSON.GET object "{"foo":"bar","ans":42}" 127.0.0.1:6379> JSON.GET object .ans "42" https://redislabs.com/blog/redis-as-a-json-store/
  • 29. REDISEARCH - REDIS POWERED SEARCH ENGINE Auto completion 127.0.0.1:6379> FT.SUGADD autocomplete “hello world” 100 OK 127.0.0.1:6379> FT.SUGGET autocomplete “he” 1) "hello world“ Full text search 127.0.0.1:6379> FT.ADD myIdx doc1 1.0 FIELDS title “hello” body “bla” url “http://redis.io” OK 127.0.0.1:6379> FT.SEARCH myIdx “hello world” LIMIT 0 10 1) (integer) 1 2) “doc1” 3) 1) “title” 2) “hello” 3) “body” 4) “bla” 5) "url” 6) “http://redis.io” http://redisearch.io/Quick_Start/ docker run -p 6379:6379 redislabs/redisearch:latest
  • 31. CLIENTS NODE.JS Create a client and connect Create an event handler Subscribe to a channel
  • 32. CLIENTS SPRING BOOT • There is no annotation available to • Create a container • Register a listener to the container • Register a receiver to the listener • This requires more code than for example listening to a Kafka topic https://spring.io/guides/gs/messaging-redis/
  • 33. CLIENTS SPRING BOOT Wait for a single message
  • 35. SOME THINGS TO MIND IN PRODUCTION • Redis is single threaded • Want to use more CPU’s? Use more Redis instances! • Requests are blocking. Be careful with for example KEYS commands. Mind the time complexity of operations! • Mind the number of connections! • Implement a proxy, for example twemproxy (manages persistent connections) • Snapshotting is blocking • Investigate persistence requirements and consider rolling BGSAVE, OAF instead of snapshotting http://tech.trivago.com/2017/01/25/learn-redis-the-hard-way-in-production/

Editor's Notes

  • #8: Caching like memcached, persistence like MongoDB