SlideShare une entreprise Scribd logo
1  sur  9
Sorted Sets
Introduction to Redis Data Structures:
What is Redis?
Open Source, NoSQL Database
Used by: Twitter, Pinterest, GitHub
Stores Advanced Data Structures
Client Support: Java, C, Node.js etc
Introduction to Redis Data Structures: Sorted Sets
What are Sorted Sets?
Redis’s most advanced data structure
A unique collection of ordered Redis Strings that have a numeric score
associated with them
Ordering is based on scores and the string lexicographical order
The average case insertion, removal and search in sorted sets are O(N), where
N is the number of elements in the set.
Introduction to Redis Data Structures: Sorted Sets
Common Use Cases for Sorted Sets
Used as a scoreboard: maintaining an
ordered list of unique members sorted by
their scores.
Sorted sets with identical scores are used as
indexes in Redis, from simple to
They have a relatively larger memory
footprint and exact numbers will depend on
the nature of the data set
Introduction to Redis Data Structures: Sorted Sets
Sorted Set Operations in Redis
ZADD ZRANK
ZCARD ZREM
ZCOUNT ZSCORE
ZRANGE ZSCAN
The complete list of set related Redis commands can be found here.
Introduction to Redis Data Structures: Sorted Sets
Internal Implementation
Implemented as a dual data structure: It is
a combination of both a hash and skip
list
Skip list ensures that searches are fast
Most operations on averages are O(log N)
Introduction to Redis Data Structures: Sorted Sets
Redis Hashes vs Redis Sorted Sets
Optimized for size when they are
small
Works well with most apps
Collections of strings
Introduction to Redis Data Structures: Sorted Sets
Sorted sets are stored as only
hashes until they grow to a
certain size
Summary
Sorted sets have fairly advanced use cases
The real value of sorted sets shines in it’s range based on queries within the set
Redis sorted sets support a variety of operations from simple set, get, member
count to complex lexicographic range calculations
Sorted sets are sorted by their score in an ascending order
Introduction to Redis Data Structures: Sorted Sets
Sign Up for a free 30 day Trial
Thanks for reading! Full Article here
Hosting & management for MongoDB® and Redis®. NoSQL management Simplified.
Click here for more information on Redis Hosting

Contenu connexe

Tendances

How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...
How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...
How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...
4Science
 

Tendances (20)

Tree in Discrete structure
Tree in Discrete structureTree in Discrete structure
Tree in Discrete structure
 
Indexing, searching, and aggregation with redi search and .net
Indexing, searching, and aggregation with redi search and .netIndexing, searching, and aggregation with redi search and .net
Indexing, searching, and aggregation with redi search and .net
 
Beecher cni fall 2010 v4
Beecher cni fall 2010 v4Beecher cni fall 2010 v4
Beecher cni fall 2010 v4
 
Data storage and indexing
Data storage and indexingData storage and indexing
Data storage and indexing
 
What is SEND?
What is SEND?What is SEND?
What is SEND?
 
DSpace-CRIS & OpenAIRE
DSpace-CRIS & OpenAIREDSpace-CRIS & OpenAIRE
DSpace-CRIS & OpenAIRE
 
Force2015 orcid poster
Force2015 orcid posterForce2015 orcid poster
Force2015 orcid poster
 
The reach of Crossref metadata and who is using it
The reach of Crossref metadata and who is using itThe reach of Crossref metadata and who is using it
The reach of Crossref metadata and who is using it
 
Collecting and using funding data in your publications
Collecting and using funding data in your publicationsCollecting and using funding data in your publications
Collecting and using funding data in your publications
 
Enhancing Interoperability: The Implementation of OpenAIRE Guidelines and COA...
Enhancing Interoperability: The Implementation of OpenAIRE Guidelines and COA...Enhancing Interoperability: The Implementation of OpenAIRE Guidelines and COA...
Enhancing Interoperability: The Implementation of OpenAIRE Guidelines and COA...
 
Data cloud lab version v.001.2020
Data cloud lab version v.001.2020Data cloud lab version v.001.2020
Data cloud lab version v.001.2020
 
Extending DSpace 7: DSpace-CRIS and DSpace-GLAM for empowered repositories an...
Extending DSpace 7: DSpace-CRIS and DSpace-GLAM for empowered repositories an...Extending DSpace 7: DSpace-CRIS and DSpace-GLAM for empowered repositories an...
Extending DSpace 7: DSpace-CRIS and DSpace-GLAM for empowered repositories an...
 
ICIC 2014 New Product Introduction Minesoft
ICIC 2014 New Product Introduction MinesoftICIC 2014 New Product Introduction Minesoft
ICIC 2014 New Product Introduction Minesoft
 
News about DSpace-CRIS Anwendertreffen 2020
News about DSpace-CRIS Anwendertreffen 2020News about DSpace-CRIS Anwendertreffen 2020
News about DSpace-CRIS Anwendertreffen 2020
 
Saran 01.06.2015
Saran 01.06.2015Saran 01.06.2015
Saran 01.06.2015
 
DSpace-CRIS 7: What is Coming? OR2020
DSpace-CRIS 7: What is Coming? OR2020DSpace-CRIS 7: What is Coming? OR2020
DSpace-CRIS 7: What is Coming? OR2020
 
4Science presentes: ORCiD API Tutorial
4Science presentes: ORCiD API Tutorial4Science presentes: ORCiD API Tutorial
4Science presentes: ORCiD API Tutorial
 
How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...
How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...
How to enhance your DSpace repository: use cases for DSpace-CRIS, DSpace-RDM,...
 
Collecting and analyzing sensor data with hadoop or other no sql databases
Collecting and analyzing sensor data with hadoop or other no sql databasesCollecting and analyzing sensor data with hadoop or other no sql databases
Collecting and analyzing sensor data with hadoop or other no sql databases
 
II-SDV 2016 Minesoft
II-SDV 2016 MinesoftII-SDV 2016 Minesoft
II-SDV 2016 Minesoft
 

En vedette

Riak seattle-meetup-august
Riak seattle-meetup-augustRiak seattle-meetup-august
Riak seattle-meetup-august
pharkmillups
 
Riak Use Cases : Dissecting The Solutions To Hard Problems
Riak Use Cases : Dissecting The Solutions To Hard ProblemsRiak Use Cases : Dissecting The Solutions To Hard Problems
Riak Use Cases : Dissecting The Solutions To Hard Problems
Andy Gross
 
The way to set automation testing
The way to set automation testingThe way to set automation testing
The way to set automation testing
Duy Tan Geek
 
Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)
Chris Richardson
 

En vedette (20)

Introduction to some top Redis use cases
Introduction to some top Redis use casesIntroduction to some top Redis use cases
Introduction to some top Redis use cases
 
Introduction to Redis Data Structures
Introduction to Redis Data Structures Introduction to Redis Data Structures
Introduction to Redis Data Structures
 
Riak add presentation
Riak add presentationRiak add presentation
Riak add presentation
 
Riak seattle-meetup-august
Riak seattle-meetup-augustRiak seattle-meetup-august
Riak seattle-meetup-august
 
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm:  "Don't Use My Database."Basho and Riak at GOTO Stockholm:  "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
 
Scaling with Riak at Showyou
Scaling with Riak at ShowyouScaling with Riak at Showyou
Scaling with Riak at Showyou
 
Redis : Play buzz uses Redis
Redis : Play buzz uses RedisRedis : Play buzz uses Redis
Redis : Play buzz uses Redis
 
Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)
 
Riak Use Cases : Dissecting The Solutions To Hard Problems
Riak Use Cases : Dissecting The Solutions To Hard ProblemsRiak Use Cases : Dissecting The Solutions To Hard Problems
Riak Use Cases : Dissecting The Solutions To Hard Problems
 
An intro to Neo4j and some use cases (JFokus 2011)
An intro to Neo4j and some use cases (JFokus 2011)An intro to Neo4j and some use cases (JFokus 2011)
An intro to Neo4j and some use cases (JFokus 2011)
 
Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)
 
Redis use cases
Redis use casesRedis use cases
Redis use cases
 
Advanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware FrameworkAdvanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware Framework
 
Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)
 
Best Buy Web 2.0
Best Buy Web 2.0Best Buy Web 2.0
Best Buy Web 2.0
 
Redis and its many use cases
Redis and its many use casesRedis and its many use cases
Redis and its many use cases
 
The way to set automation testing
The way to set automation testingThe way to set automation testing
The way to set automation testing
 
The BestBuy.com Cloud Architecture
The BestBuy.com Cloud ArchitectureThe BestBuy.com Cloud Architecture
The BestBuy.com Cloud Architecture
 
Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
 
Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)
 

Similaire à Introduction to Redis Data Structures: Sorted Sets

Similaire à Introduction to Redis Data Structures: Sorted Sets (20)

NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 
Cs437 lecture 14_15
Cs437 lecture 14_15Cs437 lecture 14_15
Cs437 lecture 14_15
 
DMBS Indexes.pptx
DMBS Indexes.pptxDMBS Indexes.pptx
DMBS Indexes.pptx
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
2_Redis.pptx very useful for begginers yes
2_Redis.pptx very useful for begginers yes2_Redis.pptx very useful for begginers yes
2_Redis.pptx very useful for begginers yes
 
Annotating search results from web databases-IEEE Transaction Paper 2013
Annotating search results from web databases-IEEE Transaction Paper 2013Annotating search results from web databases-IEEE Transaction Paper 2013
Annotating search results from web databases-IEEE Transaction Paper 2013
 
Queryproc2
Queryproc2Queryproc2
Queryproc2
 
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AIRed Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
Red Hat Summit Connect 2023 - Redis Enterprise, the engine of Generative AI
 
Unit08 dbms
Unit08 dbmsUnit08 dbms
Unit08 dbms
 
Redis data structure and Performance Optimization
Redis data structure and Performance OptimizationRedis data structure and Performance Optimization
Redis data structure and Performance Optimization
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
 
Nosql Introduction
Nosql IntroductionNosql Introduction
Nosql Introduction
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
No sql
No sqlNo sql
No sql
 
Nosql
NosqlNosql
Nosql
 
Which no sql database
Which no sql databaseWhich no sql database
Which no sql database
 
Nosql
NosqlNosql
Nosql
 
Database management system session 6
Database management system session 6Database management system session 6
Database management system session 6
 
Indexing techniques
Indexing techniquesIndexing techniques
Indexing techniques
 
EVALUATING CASSANDRA, MONGO DB LIKE NOSQL DATASETS USING HADOOP STREAMING
EVALUATING CASSANDRA, MONGO DB LIKE NOSQL DATASETS USING HADOOP STREAMINGEVALUATING CASSANDRA, MONGO DB LIKE NOSQL DATASETS USING HADOOP STREAMING
EVALUATING CASSANDRA, MONGO DB LIKE NOSQL DATASETS USING HADOOP STREAMING
 

Dernier

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Dernier (20)

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 

Introduction to Redis Data Structures: Sorted Sets

  • 1. Sorted Sets Introduction to Redis Data Structures:
  • 2. What is Redis? Open Source, NoSQL Database Used by: Twitter, Pinterest, GitHub Stores Advanced Data Structures Client Support: Java, C, Node.js etc Introduction to Redis Data Structures: Sorted Sets
  • 3. What are Sorted Sets? Redis’s most advanced data structure A unique collection of ordered Redis Strings that have a numeric score associated with them Ordering is based on scores and the string lexicographical order The average case insertion, removal and search in sorted sets are O(N), where N is the number of elements in the set. Introduction to Redis Data Structures: Sorted Sets
  • 4. Common Use Cases for Sorted Sets Used as a scoreboard: maintaining an ordered list of unique members sorted by their scores. Sorted sets with identical scores are used as indexes in Redis, from simple to They have a relatively larger memory footprint and exact numbers will depend on the nature of the data set Introduction to Redis Data Structures: Sorted Sets
  • 5. Sorted Set Operations in Redis ZADD ZRANK ZCARD ZREM ZCOUNT ZSCORE ZRANGE ZSCAN The complete list of set related Redis commands can be found here. Introduction to Redis Data Structures: Sorted Sets
  • 6. Internal Implementation Implemented as a dual data structure: It is a combination of both a hash and skip list Skip list ensures that searches are fast Most operations on averages are O(log N) Introduction to Redis Data Structures: Sorted Sets
  • 7. Redis Hashes vs Redis Sorted Sets Optimized for size when they are small Works well with most apps Collections of strings Introduction to Redis Data Structures: Sorted Sets Sorted sets are stored as only hashes until they grow to a certain size
  • 8. Summary Sorted sets have fairly advanced use cases The real value of sorted sets shines in it’s range based on queries within the set Redis sorted sets support a variety of operations from simple set, get, member count to complex lexicographic range calculations Sorted sets are sorted by their score in an ascending order Introduction to Redis Data Structures: Sorted Sets
  • 9. Sign Up for a free 30 day Trial Thanks for reading! Full Article here Hosting & management for MongoDB® and Redis®. NoSQL management Simplified. Click here for more information on Redis Hosting