This document introduces Redis, a popular open-source key-value NoSQL database. It discusses what Redis is, where it is used (server-side/backend), who uses it (many companies), and why it is useful (features like session storage, caching, queues, and real-time analytics). The document then covers Redis' main features like being lightweight, supporting complex data structures, and having language bindings for many languages. It provides an example use case of Redis being used to cache user sessions and feeds for a productivity application called Dailyfocus to reduce latency and server costs. In the end, useful Redis resources are listed for learning more.
8. Jorge Ferreiro @jgferreiro | Introducing Redis
What is Redis?
Redis is the most popular(1) key-value
NoSQL database
Created in 2009 by Salvatore Sanfilippo.
[1] 22 May 2017 - https://db-engines.com/en/ranking/key-value+store
14. Jorge Ferreiro @jgferreiro | Introducing Redis
Main features
• Easy to use and lightweight
• Open source! (Yay! 👌)
• Supports complex data structure on the
value field 💃
• Tons of languages supported! (🔥)
Go, JavaScript (Node.js), Ruby, Java, PhP, Python…
• Redis clusters!
16. @jgferreiro - Introducing Redis
Basic Redis operations
Store
• SET name Jorge
• LPUSH names Jorge Paul Bla
Retrieve
• GET name => Jorge
• LINDEX names 1 => Paul
More useful operations
• INCR number => 11
• EXPIRE number 120
21. Jorge Ferreiro @jgferreiro | Introducing Redis
The Problem
1. Calling APIS are costly and in Dailyfocus
we are constantly doing it :)
2. Delays on loading time make users angry
3. High server costs 💰$$$ and workloads
increased without caching
23. Jorge Ferreiro @jgferreiro | Introducing Redis
The Solution (I)
Caching user Sessions
Requests
Server parses request and gets sessions from Redis
24. Jorge Ferreiro @jgferreiro | Introducing Redis
The Solution (II)
No cached?
Update
cache
Call to
MongoDB,
external
APIS, etc…
to reduce latency and waiting time
…
Caching user Feeds