Caching solutions with Redis

33 %
67 %
Information about Caching solutions with Redis
Technology

Published on February 18, 2014

Author: GeorgePlaton

Source: slideshare.net

Description

Caching solutions with Redis - presentation held by Bogdan Hadadea at Open Coffee Tech meetup

Caching Solutions: Redis with Bogdan Hadadea

1. General Description: Redis • • • • NoSQL key-value date store Like MongoDB, but better Built-in persistence More data types o o o o String Hash Set List • Built-in pub/sub feature • Highly scalable

1. General Description: Redis • • • • • • • Creator: Salvatore Sanfilippo Released: 2009 Written in ANSI C Single threaded Open Source Backed by VMWare Early adopted by GitHub

2. Usage: Redis – Who? • StackOverflow – 3 layers of caching o Local cache o Site cache o Global cache • Blizzard – 8 node Redis install o 16GB/instance o For storing auction house and serving avatars • Amazon ElastiCache, Redis-to-go o Cache in the cloud o Cache hosting

2. Usage: Redis – What for? • Redis for cache o Good to place sessions – hashes o A fine place for high score tracking – sorted sets • Redis as database o Persistence to disk o High performance • Redis as message bus o Based on Pub/Sub functionality o Queues with list structures o Resque – Ruby library for creating background jobs

3. Architecture: Redis – Overview

3. Architecture: Redis • Request/Response Protocols: o Redis is a TCP server using the client-server model Request/Response protocol • Pipelining: o Process multiple requests even if response not read yet o Not paying the RTT (Round Trip Time) for every command • Limitations: o Responses stored in a queue o Recommended max: 10k commands • Benchmark: ‘Ping’ – 10k times

3. Architecture: Redis • Scripting o o o o Lua interpreter built in ver. > 2.6 Using EVAL and EVALSHA Conversion between Lua and Redis data types redis.call() & redis.pcall() o Atomicity of scripts o Emitting Redis logs from scripts o EVALSHA in the context of pipelining

3. Architecture: Redis • Replication: o o o o o o o o o o o o o Master-slave: exact copies Asynchronous replication Master – multiple slaves Non-blocking replication – master side Non-blocking replication – slave side – old dataset Slaves accept connections from other slaves Replication for scalability Replication for cost saving Full/Partial synchronization Configure: slaveof 192.168.1.1 6379 Read-only slaves Slave authentication to master Write only when N replicas

3. Architecture: Redis • Redis Transactions: o No rollback o Optimistic locking

3. Architecture: Redis • Publisher/Subscriber messaging paradigm o Decoupling pub-sub o Pattern matching subscriptions • Redis clustering o Not production ready • Memory optimization o Encoding of small data – up to 5x less space o Using 32bit instances • Using hashes to abstract a key-value on top of Redis

4. Comparison: Memcached

4. Comparison: Memcached

5. Conclusion • • • • Focused on speed Reliable as database Steeper learning curve than other solutions Still improving

Add a comment

Related presentations

Related pages

Redis for Caching - Redis Labs

Caching is best done with Redis ... Forgot your password? Enter your email address below to have your password reset.
Read more

Redis

Redis 3.2.3 is the latest stable version. Interested in release candidates or unstable versions? Check the downloads page. Quick links. Follow day ...
Read more

Mehr WordPress Speed durch Redis-Caching - lamp-solutions.de

Es gibt viele WordPress-Plugins die schnelles Caching versprechen. Der Ansatz dieser Plugins beschränkt sich meistens darin die WordPress-Inhalte als ...
Read more

caching - Memcached vs. Redis? - Stack Overflow

We're using a Ruby web-app with Redis server for caching. ... Memcached vs. Redis? ... Most memcache session solutions use cookies as a backup I believe.
Read more

caching - Redis vs Appfabric Cache , Or another solution ...

Redis vs Appfabric Cache , Or another solution. ... Browse other questions tagged caching redis memcached appfabric appfabric-cache or ask your own question.
Read more

A simple C# cache component using Redis as provider ...

Caching is nothing new. You can simply put your data in a cache provider you commonly use, but what if you could have a strategy and a simple ...
Read more

Redis Use Case Solutions

Redis solves many common problems across industries and use cases. Learn more about use case solutions powered by Redis.
Read more

Caching: Distributed, In-memory Cache for Windows Azure

Microsoft Azure Cache is a family of distributed, in-memory, scalable solutions that enable you to build highly scalable and responsive ...
Read more