SlideShare una empresa de Scribd logo
1 de 30
This is REDIS
- Feature and USECASE
About Me
 Kris jeong(정경석)
 Author a Book of REDIS
 ‘This is REDIS’ in korean

 Software development
Over 14 years.
 Web service dev.
 Messaging server dev.

 Recommendation dev.

 Interested about NoSQL
http://www.aladin.co.kr/shop/wproduct.aspx?ISBN=8968480591
What is
 REDIS is In-Memory Database

 Variety data types
 Support persistence
 Key value based NoSQL
IMDB(In-Memory DB)
Disk based data store

In-Memory data store

Query Engine

Query Engine

Speed

Storage
Manager

Memory(Cache)

Disk

Memory

Durability

Disk is optional

Disk
Redis is cache server?

Not a cache server.
But, It can be.
Turn off Persistence.
Running platform

https://github.com/MSOpenTech/redis
Install and test
$ wget http://download.redis.io/redis-stable.tar.gz
$ tar xvf redis-stable.tar.gz
$ cd redis-stable
$ make
…
…
done.
$ make test

※ CentOS 6.4 64bit
Feature
Super fast (TPS)
$ ./src/redis-benchmark --csv -d 1024
"PING_INLINE","34602.07"
"PING_BULK","35971.22"
"SET","35211.27"
"GET","31347.96"
…
"LPUSH (needed to benchmark LRANGE)","32467.53"
"LRANGE_100 (first 100 elements)","4714.76"
"LRANGE_300 (first 300 elements)","1605.91"
"LRANGE_500 (first 450 elements)","1030.93"
"LRANGE_600 (first 600 elements)","735.13"
"MSET (10 keys)","22471.91"

※ CentOS 6.4 64bit, Core i5 3337U@1.8Gz
Feature - expire
 Duration cache
 expire user:212:cart 259200

seconds

It will be expired 3 days later.

 Specified time cache
 expireat user:212:item:sward 1388534400
It will be expired 2014/01/01

Unix timestamp
Support data types
 String

key

value
{
"product": {
"id": "2951",
"name": "testing 01",
"options": {
"color": "red"
},
"quantity": 4
}

user:1:cart_info

}

※ Up to 512MB
Support data types (cont.)
 Hash

Key

field

value

name
min damage

13

max damage

20

durability

32/50

price

item:1:info

bastard sword

3500

add a new value
durability

31/50
Support data types (cont.)
 Hash

Key

field

value

name
min damage
item:1:info

bastard sword
13

max damage

20

durability

31/50
32/50

price

3500
Support data types (cont.)
 List

Key
user:1:messag
e

elements

hi~

how r you.

bye.

add a new value
Support data types (cont.)
 List

Key
user:1:messag
e

elements

hi~

how r you.

bye.
Support data types (cont.)
 Set

kris
mike
frank

user:1:friend

martin

tom

add a new value
chris
Support data types (cont.)
 Set

kris
mike
user:1:friend

frank
martin

tom
chris
Support data types (cont.)
 Sorted Set

score

Key

value

1
91

mike

200

frank

250

martin

251

user:ranking

kris

tom

add a new value
220

chris
Support data types (cont.)
 Sorted Set

Key

score

value

1
91

user:ranking

kris
mike

200

frank

220
250

chris
martin

250
251

martin
tom

251

tom
Feature – RDB(Snapshot)
Redis instance

Redis data

Data dump
to disk

Dump file
(Redis.rdb)

When snapshot event raised
Check point of Redis snapshot
 Redis data size vs Physical memory size ratio
 vm.overcommit_memory setting
 Disk I/O rate for swap
Feature – AOF(Append Only File)
Redis instance
Command
logging

Redis data

Data change command
Redis client

Check point of Redis aof
 Disk space
 Restart time is slower than RDB

appendonly.aof
Replication – Single slave
Redis cluster

Master Node

Slave Node

Replication
key1

test value

set key1 ‘test value’ key1

set key1 ‘test value’
Redis client

test value
Replication – Multiple slave
Redis cluster
Slave Node 1

Replication
Master Node

Slave Node 2

Slave Node 3

Read

Write
Redis client
Replication – Multiple slave (cont.)
Redis cluster
1st Replication
Master Node

Slave Node 1
2nd Replication

Slave Node 2

Slave Node 3

Write
Redis client

Slave Node 4

Read
Redis client
Sharding – range
● Data range based data split
User Key 1 ~ 100
User Key 1~50

User Key 51~100

Shard 1

Shard 2

Master Node

Master Node

Slave Node

Slave Node

Slave Node

Slave Node
Sharding - vertical
● Schema based data split
User info

Content

Shard 1

Shard 2

Master Node

Master Node

Slave Node

Slave Node

Slave Node

Slave Node
Sharding - consistent hashing
● Key based data split
User Key 1 ~ 100
Key % Number of Shard(Key % 2)

Shard 1

Shard 2

Master Node

Master Node

Slave Node

Slave Node

Slave Node

Slave Node
Sharding – Redis client
Shard 1

Shard N
…

Sharding Calc
Read/Write

Read/Write
Redis client

Check point of Redis Sharding
 Redis does not support server-side sharding
 Most Redis client support hash based sharding
 Re sharding issue
Useage
PV/UV Calculation 1Billion user
 Daily logged in user count
 Weekly logged in user count
 List of Logged-in account at least once of week

Most popular News list - Real time
 Top 10 of news by click count
 News list by popular by comment count

Real time gamers ranking
 Score based Top 10 ranker.

 Recent user list
Demo

Más contenido relacionado

La actualidad más candente

Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practiceEugene Fidelin
 
Redis Introduction
Redis IntroductionRedis Introduction
Redis IntroductionAlex Su
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
深入了解Redis
深入了解Redis深入了解Redis
深入了解Redisiammutex
 
Everything you always wanted to know about Redis but were afraid to ask
Everything you always wanted to know about Redis but were afraid to askEverything you always wanted to know about Redis but were afraid to ask
Everything you always wanted to know about Redis but were afraid to askCarlos Abalde
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAli MasudianPour
 
Your 1st Ceph cluster
Your 1st Ceph clusterYour 1st Ceph cluster
Your 1st Ceph clusterMirantis
 
Ceph Performance and Sizing Guide
Ceph Performance and Sizing GuideCeph Performance and Sizing Guide
Ceph Performance and Sizing GuideJose De La Rosa
 
Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)
Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)
Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)Ontico
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the roadYi-Feng Tzeng
 
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Ontico
 
Setting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSetting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSudheer Kondla
 
SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)Lars Marowsky-Brée
 

La actualidad más candente (20)

Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practice
 
Redis Introduction
Redis IntroductionRedis Introduction
Redis Introduction
 
redis basics
redis basicsredis basics
redis basics
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
深入了解Redis
深入了解Redis深入了解Redis
深入了解Redis
 
Everything you always wanted to know about Redis but were afraid to ask
Everything you always wanted to know about Redis but were afraid to askEverything you always wanted to know about Redis but were afraid to ask
Everything you always wanted to know about Redis but were afraid to ask
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL database
 
Your 1st Ceph cluster
Your 1st Ceph clusterYour 1st Ceph cluster
Your 1st Ceph cluster
 
Bluestore
BluestoreBluestore
Bluestore
 
Ceph Performance and Sizing Guide
Ceph Performance and Sizing GuideCeph Performance and Sizing Guide
Ceph Performance and Sizing Guide
 
Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)
Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)
Ceph BlueStore - новый тип хранилища в Ceph / Максим Воронцов, (Redsys)
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the road
 
Redis database
Redis databaseRedis database
Redis database
 
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
 
Redis acc 2015_eng
Redis acc 2015_engRedis acc 2015_eng
Redis acc 2015_eng
 
Setting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSetting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutes
 
Redis tutoring
Redis tutoringRedis tutoring
Redis tutoring
 
librados
libradoslibrados
librados
 
SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)
 

Similar a This is redis - feature and usecase

Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSAmazon Web Services
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
 
Storage, San And Business Continuity Overview
Storage, San And Business Continuity OverviewStorage, San And Business Continuity Overview
Storage, San And Business Continuity OverviewAlan McSweeney
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Redis Labs
 
Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...
Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...
Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...Red_Hat_Storage
 
Day 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConfDay 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConfRedis Labs
 
Hadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_PlanHadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_PlanNarayana B
 
Data Replication Options in AWS
Data Replication Options in AWSData Replication Options in AWS
Data Replication Options in AWSIrawan Soetomo
 
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 LabsRedis Labs
 
Quick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterQuick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterPatrick Quairoli
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisItamar Haber
 
quickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminquickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminjorgesimao71
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...javier ramirez
 

Similar a This is redis - feature and usecase (20)

Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWS
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Ceph
CephCeph
Ceph
 
Storage, San And Business Continuity Overview
Storage, San And Business Continuity OverviewStorage, San And Business Continuity Overview
Storage, San And Business Continuity Overview
 
Intro to Apache Spark
Intro to Apache SparkIntro to Apache Spark
Intro to Apache Spark
 
Intro to Apache Spark
Intro to Apache SparkIntro to Apache Spark
Intro to Apache Spark
 
Firebird and RAID
Firebird and RAIDFirebird and RAID
Firebird and RAID
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
 
SQL 2005 Disk IO Performance
SQL 2005 Disk IO PerformanceSQL 2005 Disk IO Performance
SQL 2005 Disk IO Performance
 
Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...
Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...
Red Hat Storage Day Dallas - Red Hat Ceph Storage Acceleration Utilizing Flas...
 
Day 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConfDay 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConf
 
Hadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_PlanHadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_Plan
 
Data Replication Options in AWS
Data Replication Options in AWSData Replication Options in AWS
Data Replication Options in AWS
 
Redis meetup
Redis meetupRedis meetup
Redis meetup
 
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
 
In-memory database
In-memory databaseIn-memory database
In-memory database
 
Quick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterQuick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage Cluster
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
quickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminquickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-admin
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

This is redis - feature and usecase

  • 1. This is REDIS - Feature and USECASE
  • 2. About Me  Kris jeong(정경석)  Author a Book of REDIS  ‘This is REDIS’ in korean  Software development Over 14 years.  Web service dev.  Messaging server dev.  Recommendation dev.  Interested about NoSQL http://www.aladin.co.kr/shop/wproduct.aspx?ISBN=8968480591
  • 3. What is  REDIS is In-Memory Database  Variety data types  Support persistence  Key value based NoSQL
  • 4. IMDB(In-Memory DB) Disk based data store In-Memory data store Query Engine Query Engine Speed Storage Manager Memory(Cache) Disk Memory Durability Disk is optional Disk
  • 5. Redis is cache server? Not a cache server. But, It can be. Turn off Persistence.
  • 7. Install and test $ wget http://download.redis.io/redis-stable.tar.gz $ tar xvf redis-stable.tar.gz $ cd redis-stable $ make … … done. $ make test ※ CentOS 6.4 64bit
  • 9. Super fast (TPS) $ ./src/redis-benchmark --csv -d 1024 "PING_INLINE","34602.07" "PING_BULK","35971.22" "SET","35211.27" "GET","31347.96" … "LPUSH (needed to benchmark LRANGE)","32467.53" "LRANGE_100 (first 100 elements)","4714.76" "LRANGE_300 (first 300 elements)","1605.91" "LRANGE_500 (first 450 elements)","1030.93" "LRANGE_600 (first 600 elements)","735.13" "MSET (10 keys)","22471.91" ※ CentOS 6.4 64bit, Core i5 3337U@1.8Gz
  • 10. Feature - expire  Duration cache  expire user:212:cart 259200 seconds It will be expired 3 days later.  Specified time cache  expireat user:212:item:sward 1388534400 It will be expired 2014/01/01 Unix timestamp
  • 11. Support data types  String key value { "product": { "id": "2951", "name": "testing 01", "options": { "color": "red" }, "quantity": 4 } user:1:cart_info } ※ Up to 512MB
  • 12. Support data types (cont.)  Hash Key field value name min damage 13 max damage 20 durability 32/50 price item:1:info bastard sword 3500 add a new value durability 31/50
  • 13. Support data types (cont.)  Hash Key field value name min damage item:1:info bastard sword 13 max damage 20 durability 31/50 32/50 price 3500
  • 14. Support data types (cont.)  List Key user:1:messag e elements hi~ how r you. bye. add a new value
  • 15. Support data types (cont.)  List Key user:1:messag e elements hi~ how r you. bye.
  • 16. Support data types (cont.)  Set kris mike frank user:1:friend martin tom add a new value chris
  • 17. Support data types (cont.)  Set kris mike user:1:friend frank martin tom chris
  • 18. Support data types (cont.)  Sorted Set score Key value 1 91 mike 200 frank 250 martin 251 user:ranking kris tom add a new value 220 chris
  • 19. Support data types (cont.)  Sorted Set Key score value 1 91 user:ranking kris mike 200 frank 220 250 chris martin 250 251 martin tom 251 tom
  • 20. Feature – RDB(Snapshot) Redis instance Redis data Data dump to disk Dump file (Redis.rdb) When snapshot event raised Check point of Redis snapshot  Redis data size vs Physical memory size ratio  vm.overcommit_memory setting  Disk I/O rate for swap
  • 21. Feature – AOF(Append Only File) Redis instance Command logging Redis data Data change command Redis client Check point of Redis aof  Disk space  Restart time is slower than RDB appendonly.aof
  • 22. Replication – Single slave Redis cluster Master Node Slave Node Replication key1 test value set key1 ‘test value’ key1 set key1 ‘test value’ Redis client test value
  • 23. Replication – Multiple slave Redis cluster Slave Node 1 Replication Master Node Slave Node 2 Slave Node 3 Read Write Redis client
  • 24. Replication – Multiple slave (cont.) Redis cluster 1st Replication Master Node Slave Node 1 2nd Replication Slave Node 2 Slave Node 3 Write Redis client Slave Node 4 Read Redis client
  • 25. Sharding – range ● Data range based data split User Key 1 ~ 100 User Key 1~50 User Key 51~100 Shard 1 Shard 2 Master Node Master Node Slave Node Slave Node Slave Node Slave Node
  • 26. Sharding - vertical ● Schema based data split User info Content Shard 1 Shard 2 Master Node Master Node Slave Node Slave Node Slave Node Slave Node
  • 27. Sharding - consistent hashing ● Key based data split User Key 1 ~ 100 Key % Number of Shard(Key % 2) Shard 1 Shard 2 Master Node Master Node Slave Node Slave Node Slave Node Slave Node
  • 28. Sharding – Redis client Shard 1 Shard N … Sharding Calc Read/Write Read/Write Redis client Check point of Redis Sharding  Redis does not support server-side sharding  Most Redis client support hash based sharding  Re sharding issue
  • 29. Useage PV/UV Calculation 1Billion user  Daily logged in user count  Weekly logged in user count  List of Logged-in account at least once of week Most popular News list - Real time  Top 10 of news by click count  News list by popular by comment count Real time gamers ranking  Score based Top 10 ranker.  Recent user list
  • 30. Demo