Your SlideShare is downloading. ×
0
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Redis Introduction
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Redis Introduction

950

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
950
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
24
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. What is Redis An open source, BSD licensed, advanced key-value store Sponsored by
  • 2. Who's using Redis?
  • 3. Supported Platforms  Linux  Mac OS X  FreeBSD  Solaris  Windows  no official support
  • 4. Supported Languages  ActionScript  C  C++  C#  Clojure  Common Lisp  Dart  Erlang  Go  Haskell  Haxe  Java  Io  server-side JavaScript (Node.js)  Lua  Objective-C  Perl  PHP  Pure Data  Python  Ruby  Scala  Smalltalk  Tcl
  • 5. Data types  Strings  with a maximum of 512MB  Lists  Sets  Sorted sets  Set with score  Hashes  Perfect to represent object
  • 6. Commands  SET  GET  INCR  DECR  LPUSH  LRANGE  LLEN  EXPIRE  TTL  SADD  SMEMBERS  SCARD  SREM  ZADD  ZRANGE  ZREVRANGE  ZCARD  ZREM  HSET  HGET  HGETALL
  • 7. Publish–subscribe  Redis supports publish-subscribe mode.  You can subscribe some topics, and when someone publish topic matches your interest, redis send it to you.
  • 8. Lua scripting  Scripting makes Redis much faster for complex operations  read-compute-write workflow
  • 9. Pipelining  NOT Redis transactions  Does not provide atomicity  Nothing more complicated than the fact that Redis server is able to queue up responses in memory  Too many commands in a single pipeline may cause memory issues and potentially socket timeout. Benchmark without pipelining 1.185238 seconds with pipelining 0.250783 seconds
  • 10. Transactions  All the commands in a transaction are serialized and executed sequentially.  Either all of the commands or none are processed.  Redis does not support roll backs  A command fails to be queued  A command fails after EXEC is called(not supported)
  • 11. More use cases  Leader election  Counting semaphores  Queue  Pizza topping problem
  • 12. Persistence  Virtual Memory  RDB (Snapshots)  Take snapshot in an interval  Fast  May loss several minutes data if kill -9  Append Only File (AOF)  Log-based link binlog, redo whole steps since startup  Auto bgrewriteaof (background rewrite AOF)  Still fast enough  May loss 1 second data if kill -9
  • 13. Replication  Official Master-slave replication  Write in Master, Read in Slaves Replication • Official Master-slave replication – Write in Master, Read in Slaves
  • 14. Partitioning  Redis Cluster is currently not production ready.  Redis Cluster is a mix between query routing and client side partitioning.
  • 15. High Availability Redis Sentinel is a system designed to help managing Redis instances. It performs the following three tasks:  Monitoring  Notification  Automatic failover  Not good for production environments
  • 16. High Availability(alternative)  Virtual IP  keepalived or heartbeat  DRBD
  • 17. High Availability(alternative)  redis_failover project
  • 18. Twemproxy  Maintain persistent server connections  Keep connection count on cache servers low  Pipeline requests and responses  Use multiple server pools simultaneously  Proxy the complete memcached ASCII protocol  Easily configure server pools using a YAML file  Use multiple hashing modes, including consistent hashing  Increase observability using stats exposed on a monitoring port
  • 19. Performance Benchmark
  • 20. Cost of Redis Persistence
  • 21. Redis web admin console  Redis Commander  Redmon  Redsmin
  • 22. Redis Commander  Asfd
  • 23. Compare with Memcached
  • 24. Compare with Memcached Memcached Redis (Multi)Get V V (Multi)Set V V Incr/Decr V V Deletion V V Expiration V V Range Queries V Data Types V Persistence V Replication V Prepend/Append V 勝 勝 勝 勝 勝
  • 25. Reference  Redis Commands  Is memcached a dinosaur in comparison to Redis?  Redis Failover at Spreecast Based on Apache ZooKeeper  twemproxy
  • 26. Questions?

×