Redis: An introduction

71 %
29 %
Information about Redis: An introduction

Published on March 6, 2014

Author: vincentpro



Introduction about Redis data type and use cases

An introduction March 2014 – Septeni Technology

Over view • Memcache-ish in-memory key/value store • But values are complex data types: o blobs o lists o sets o sorted sets o hash tables • And it has persistence. • Open source; very helpful and friendly community. • Used in the real world: pinterest, github, craigslist,, engineyard...

Key Features and Cool Stuff • Speed • Master/Slave Replication • All data is eventually persistent • Handles huge workloads easily • Variety of Supported Languages • Support for atomic operations, transactions • Has pub/sub functionality • Sharding

List operations • • • • Lists are your ordinary linked lists. You can push and pop at both sides, extract range, resize.. Random access BLPOP: Blocking POP - wait until a list has elements and pop them. Useful for realtime stuff.

Set operations • • • Sets are an unordered collection of Strings Sets can be intersected/diffed /union'ed server side. Can be useful as keys when building complex schemata.

Sorted Sets • • • • Same as sets, but with score per element Ranked ranges, aggregation of scores on INTERSECT Can be used as ordered keys in complex schemata Think timestamps, inverted index, geohashing, ip ranges

Hashes • Hash tables as values • Think of an object store with atomic access to object • Members

PubSub - Publish/Subscribe • Clients can subscribe to channels or patterns and receive • Notifications when messages are sent to channels. • Use cases: chats, notifycation, real-time applications..

Common Web Use Cases Solved in Redis

Show latest items listings in your home page This is a live in-memory cache and is very fast. LPUSH is used to insert a content ID at the head of the list stored at a key. LTRIM is used to limit the number of items in the list to 5000. If the user needs to page beyond this cache only then are they sent to the database.

Leaderboards and related problems A leader board is a set sorted by score. The ZADD commands implements this directly and the ZREVRANGE command can be used to get the top 100 users by score and ZRANK can be used to get a users rank. Very direct and easy.

Counting stuff Keeping stats of all kinds is common, say you want to know when to block an IP addresss. The INCRBY command makes it easy to atomically keep counters; GETSET to atomically clear the counter; the expire attribute can be used to tell when an key should be deleted.



Thank you.

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

REDIS :: AN INTRODUCTION - The Official Rackspace Blog

This post was contributed by Zachary Schneider, RHCE, System Engineer for the Rackspace Cloud. What is Redis? Redis is an open source, in-memory ...
Read more

Introduction to Redis – Redis

*Introduction to Redis. Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker. It supports ...
Read more

An introduction to Redis data types and abstractions – Redis

*An introduction to Redis data types and abstractions. Redis is not a plain key-value store, actually it is a data structures server, supporting different ...
Read more

Azure Redis Cache 101 - Introduction to Redis

Scott talks with Saurabh Pant about the new Azure Managed Redis Cache. We'll cover a basic introduction to Redis and Redis on Windows. What kinds of things ...
Read more

Redis vs. Memcached - DZone Database

In this article, we will talk about Redis (REmote DIctionary Server). Redis is an open source, in-memory, key value store. It is also referred to as a ...
Read more

1. An Introduction to Redis - Redis Cookbook [Book]

Chapter 1. An Introduction to Redis This chapter discusses some of Redis’s basic concepts. We’ll look into when Redis is a great fit, how to install ...
Read more

Redis - Laravel - The PHP Framework For Web Artisans

Redis. Introduction; Basic Usage. Pipelining Commands; Pub / Sub; Introduction. Redis is an open source, advanced key-value store. It is often referred to ...
Read more

Redis – NoSQL Database, an introduction - w3resource

Redis – NoSQL Database, an introduction: This presentation describes an introduction of Redis, a NoSQL Database.
Read more