Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Azure Redis Cache - Cache on Steroids!

441 views

Published on

Performance is an important key in the success of a good user experienceCaching information is often the best way to achieve the performance.
Redis is far for the traditional cache which deals only with key-value pairs. Build from an open-sourceproject, it is accessible from multiple languages and supports atomic operations such as appending to a string, incrementing the value in a hash, pushing to a list, computing set intersection, union and difference, or getting the member with highest ranking in a sorted set.
This session will introduce many features of the Azure Redis Cache service through a demo application.

Published in: Technology
  • Be the first to comment

Azure Redis Cache - Cache on Steroids!

  1. 1. AZURE REDIS CACHE Cache on Steroids!
  2. 2. ABOUT ME
  3. 3. AGENDA • Redis Cache Introduction • Azure Redis • Demo - Sample Application • Data Types • Queue Pattern • Pub / Sub • Azure Scalability (Tiers)
  4. 4. REDIS DEFINITION Redis is an open source, (BSD licensed), in-memory data structure store, used as database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, and geospatial indexes with radius queries. REDIS - REmote DIctionary Server   Redis.io
  5. 5. WHO USES REDIS?
  6. 6. COMMON REDIS USAGES • Show latest items in home page • Leaderboards • Counting Stuff - Page Hits • Session State , Output Cache • Unique Visitors • Caching
  7. 7. CREATE YOUR FIRST REDIS CACHE
  8. 8. REDIS - DATA TYPES • String - key value • Lists - list of string, sorted by insertion order • Hashes - map between string fields and string values • Sets - unordered collection of strings • Sorted Set - similar to sets but each entry has an associated “score”
  9. 9. SAMPLE APPLICATION -TWEETER • Tweets • Timeline • Accounts • Account Statistics • Followers • Following • Favorite Hashtags by Marc Dugas
  10. 10. Features • Can store any kind of data (JPEG images, serialized JSON) • Maximum size 512MB Operations • INCR, DECR, INCRBY, APPEND, EXPIRE Uses • Counters (Hits), Rate Limiter (API) key value STRING DATA TYPE
  11. 11. key 9numberoffollo wers tweetcount 843 HASH DATA TYPE Features • Map between string fields and string value • 4 billion fields per hash Operations • HGET, HSET, HINCRBY Uses • Statistics for Entity (ex: Number of Followers)
  12. 12. d a bc LIST DATA TYPE Features • List of strings sorted by insertion order • Can add to head or tail • 4 billion elements per list • Very fast access to items from head/tail Operations • LPUSH, RPUSH, LRANGE, LTRIM, LPOP, RPOP Uses • Timeline
  13. 13. a e c bd f SET DATA TYPE Features • Unordered collection of strings, no repeating members • Add/Remove and test for existing extremely quick • 4 billion elements per set • Union and Intersection between sets Operations • SADD, SREM, SUNION, SINTER Uses • Common Followers
  14. 14. Features • Similar to Set → no repeating members • Each member is associated with a score that is used to order the set Operations • ZADD, ZRANGE, ZRANK Uses • Leaderboards c 9 a 3 b -1 member score SORTED SET DATA TYPE
  15. 15. background workers waitinglist processinglist producer QUEUE PATTERN Approach • Leverage the Redis List Commands to create a distributed queuing mechanism Operations • Enqueue  LPUSH (add to waitinglist) • Dequeue  RPOPLPUSH (RPOP from waitinglist, LPUSH on processinglist) • Post Processing  LREM (remove from processinglist )
  16. 16. Features • Implementation of the Publish/Subscribe paradigm • Messages are “published” into channels (no knowledge of subscribers) • Subscribers express interest in channel and receive messages from that channel Operations • PUBLISH , SUBSCRIBE, UNSUBSCRIBE Uses • Real time applications, SignalR Scaleout publisher channel subscribers PUBLISH/SUBSCRIBE PATTERN
  17. 17. REDIS COMMANDS • Console in Azure Portal • Redis command line tools redis.io/commands
  18. 18. METRICS
  19. 19. Tier Pricing Tier Node(s) Size MBPS Request per second SLA Basic C0 - C6 1 node 250MB - 53GB 5 - 2,000 600 - 150,000  Standard 2 nodes Primary/Secondary  Premium P1 - P4 1 - 1000 node(s) 6GB - 53GB 2,000 - 4,000 140,000 - 250,000  AZURE REDIS Premium Tier • Faster hardware • Higher throughput, lower latencies • Persistence • Cluster
  20. 20. WHAT’S NEXT? Azure Redis Cache - azure.microsoft.com/en- us/services/cache Redis Cache - redis.io Twitter: @fboucheros Blog: frankysnotes.com Blog (FR): cloudenfrancais.com

×