SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

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
 

What's hot (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 to 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 to 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
CephCeph
Ceph
 
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...
 
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 ...
 

Recently uploaded

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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