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.

New York REDIS Meetup Welcome Session


Published on

Published in: Technology
  • Be the first to comment

New York REDIS Meetup Welcome Session

  1. 1. New York Redis MeetupWelcome Session June 26, 2012 @ayampolskiy @dannygnj
  2. 2. Who Are We? Aleksandr Yampolskiy •CTO of Cinchcast, BlogTalkRadio, and Cinch.FM companies that provide solutions to create, share, measure, and monetize audio content. •Previously head of security and compliance for Gilt Groupe companies •Various leadership roles in Goldman Sachs, Oracle, Microsoft building scalable, enterprise software for IDM, SSO, AuthN/AuthZ. •Ph.D. in Cryptography Danny Gershman •Senior Software Engineer at Cinchcast •Previously held position as Lead Software Engineer at The NewsMarket and Synaptic Digital •Systems Architect at Innovative Systems & Solutions •Specializing in web technologies, caching, and scale.
  3. 3. What is This Meetup?• New York REDIS NOSQL Meetup• Topics of interest: REDIS, NOSQL, Engineering, Entrepreneurs, Open-Source
  4. 4. What Do You Want to Get Out Of It?
  5. 5. What is REDIS?• Database?• Caching?• Pub/Sub?• Key/Value Store?• Redis is more like a flexible tool designed to solve specific problems
  6. 6. REDISREmote DIctionary Server  ( Store “on steroids”Written by Salvatore Sanfilippo (@antirez) in2009. Now up to 2.4.13
  7. 7. Redis Manifesto– Redis is a DSL (Domain Specific Language) that manipulates abstract data types and implemented as a TCP daemon. Keys are binary-safe strings and values are different kinds of abstract data types.– Redis has persistence option but Memory storage is #1.– The Redis API is a direct consequence of fundamental data structures.– Code is like a poem.– We believe designing systems is a fight against complexity. Most of the time the best way to fight complexity is by not creating it at all.– Redis API has two levels: 1) a subset of the API fits naturally into a distributed version of Redis and 2) a more complex API that supports multi-key operations.– We optimize for joy. When there is no longer joy in writing code, the best thing to do is stop. 7
  8. 8. REDIS is Fast• Fast ~100,000 queries per sec.• Compare it with ~30,000 queries per sec for MS SQL Server (if you are lucky)• Kind of like memcached, but values can be persisted and all keys are kept IN MEMORY.
  9. 9. Modern Computer Latency L1 3 cycles Non-blocking L2 14 cycles RAM 250 cycles DISK 41,000,000 cycles Blocking NETWO 240,000,000 cycles RK Ryan Dahl, Yahoo BayJax meetup, May 2010
  10. 10. Redis VS Memcached 10
  11. 11. Who is using REDIS? 11
  12. 12. Data structuresKeys are strings which identify pieces of data(values)Values can be strings, integers, hashes, lists,sets, or sorted setsVarious atomic operations (push, pop, add,read, set, etc.) – after all REDIS is single-threaded 12
  13. 13. Many Language Bindings
  14. 14. REDIS is Simple
  15. 15. ScaleHorizontal (multiple processes)Vertical (master-slave)Master-master via zookeeper
  16. 16. Master-Master ReplicationNative Redis Master-Master replication doesn’texist yet, slated for release end of yearSolution using Apache Zookeeper ( for status using BLPOPWill promote a slave to master
  17. 17. When Not to Use RedisData is larger than memoryNeed ACID requirementsBig data
  18. 18. Security ConcernsIt is designed to be used only inside trustedenvironment (kind of like MongoDB)Basic password authentication (but it’s sent incleartext)No data encryption support 18
  19. 19. Security RecommendationsConfigure firewall to block inbound access onREDIS portsDon’t run REDIS server as root, and harden theserver it’s onDon’t store sensitive data in there. 19
  20. 20. AOP Caching• Dynamically construct a hash key from argument values.• “Round up” volatile keys such as timestamps• Put into REDIS cache with a configurable TTL• Lookup from cache before SQL server + lazy writes.
  21. 21. Real-time AnalyticsCommunicate from hydrating applicationNodeJS listens to Redis and transmits datato a page using Socket.IOHistorical data is stored in RedisPub/Sub is used to notify listening sockets
  22. 22. Studio Callers
  23. 23. Cinchcast is Hiring• Well-funded profitable startup Open Positions: used by millions. •Back-end Architect• Patented technology utilized in a new way. •Lead Front-end Engineer• Medical/dental/etc. benefits.• Great office space in mid-town •If you are good we’ll find a role right near subway.• Flexible hours. Top-notch for you : compensation + stock options.