26
Mastering Redis A Primer Data Masters

Mastering Redis A Primer

  • Upload
    joben

  • View
    134

  • Download
    1

Embed Size (px)

DESCRIPTION

Mastering Redis A Primer. Data Masters. Special Thanks To…. Planet Linux Caffe http :// planetlinuxcaffe.com. Short bio about me… Andrew Simkovsky 15 years working with database technology Worked across many industries Why Data Masters? Used to be a certification instructor – I miss it! - PowerPoint PPT Presentation

Citation preview

Page 1: Mastering Redis A Primer

Mastering RedisA Primer

Data Masters

Page 2: Mastering Redis A Primer

Special Thanks To…

Planet Linux Caffehttp://planetlinuxcaffe.com

Page 3: Mastering Redis A Primer

Short bio about me… Andrew Simkovsky 15 years working with database technology Worked across many industries

Why Data Masters? Used to be a certification instructor – I miss

it! Sharing knowledge Fostering a community

Page 4: Mastering Redis A Primer

DBTekPro

www.dbtekpro.com

[email protected]@asimkovsky

Page 5: Mastering Redis A Primer

Redis - Concept

What it is “NoSQL” Key-value store In-memory

What it’s not Definitely not “relational” Denormalization is your friend

Page 6: Mastering Redis A Primer

Redis - Uses

Caching session data Processing data at high speeds Real-time data feeds

Page 7: Mastering Redis A Primer

Where Do I Get It?

www.redis.io

Page 8: Mastering Redis A Primer

Types of Data

Page 9: Mastering Redis A Primer

Types of Data Keys Strings Hashes Lists Sets Sorted Sets Queue

Page 10: Mastering Redis A Primer

Types of Data - Keys Identifier – to find your data Converted to physical address in memory Key can be any string of characters you want

123456document:789456

Page 11: Mastering Redis A Primer

Types of Data

Stringsperson:12345 Joe

Hashesuser:1000 username smith password

p4ssw0rd9 age 34

Listsfriends:1000 123 897 567 891

Page 12: Mastering Redis A Primer

Types of Data Sets

friends:1000 123 897 567 891 Sorted Sets

scores:1000 123/500 567/600 891/700 897/800 Another view

scores:1000123 / 500567 / 600891 / 700897 / 800

Page 13: Mastering Redis A Primer

Types of Data

Queue Publisher queue Subscriber First-in, first-out (FIFO)

Page 14: Mastering Redis A Primer

Interacting With Redis

Command-line toolredis-cli

Redis Commandshttp://redis.io/commands

Transactions Server-side scripting via Lua

Page 15: Mastering Redis A Primer

Programming Clients ActionScript C, C#, C++,

Obj-C Clojure Common Lisp D Dart

Erlang Go Java Lua Node.js Perl PHP

Pure Data Python Ruby Scala Tcl

Full list at: www.redis.io/clients

Page 16: Mastering Redis A Primer

Replication Redis can support Master->Slave replication Write to one master, keeps one or more slaves up

to dateMaste

r

Slave Slave Slave

Page 17: Mastering Redis A Primer

Where’s the Bad and the Ugly?

Page 18: Mastering Redis A Primer

Persistence

Redis is primarily an in-memory database It is not really a “persistence” engine All your data must fit in memory Can configure persistence, but its not true

long-term storage Persistence is only for crash recovery

Page 19: Mastering Redis A Primer

Interactive Tutorial

http://try.redis.io

Page 20: Mastering Redis A Primer

Live Demo!

Page 21: Mastering Redis A Primer

Installation

Red Hat / RPM-based systems (Red Hat, CentOS, Fedora) Yum install, exists in most of the basic yum repositoriesyum install redis

Debian-based systems (Ubuntu) Aptitude install, exists in most apt repositories

apt-get install redis

Zip file download from redis.io

Page 22: Mastering Redis A Primer

Configure And Start

Config file: /etc/redis.conf Start/stop uses service command:

service redis [ start | stop | restart | status]

Page 23: Mastering Redis A Primer

Installing Yum Repository Redis.io: Only source code Get Yum repository from FedoraProject.org – Extra

Packages for Enteprise Linux:http://fedoraproject.org/wiki/EPEL

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmyum install redis

Page 24: Mastering Redis A Primer

Welcome To The Machine!!

You are not supposed to be here… Go watch the live demo!!

Page 25: Mastering Redis A Primer

Questions?

Page 26: Mastering Redis A Primer

Thank You For Coming!

Please rate this Meet Up:www.meetup.com/data-masters

(or go there to join!)Check out my blog and forums:

www.dbtekpro.comAfter Party!!

Miller’s Ale HouseMiracle Mile