This document summarizes a New York Redis Meetup event. It introduces Aleksandr Yampolskiy and Danny Gershman, who will discuss Redis, a key-value store that can be used for caching, publishing/subscribing, and as a data store. Redis allows for fast, in-memory storage of data structures like strings, hashes, lists, sets and sorted sets. The document provides an overview of Redis' capabilities and common uses, such as caching, real-time analytics, and AOP caching. It also notes that Cinchcast is hiring for backend architect and frontend engineer roles.
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
New York REDIS Meetup Welcome Session
1. New York Redis Meetup
Welcome Session
June 26, 2012
@ayampolskiy
@dannygnj
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. What is This Meetup?
• New York REDIS NOSQL Meetup
• Topics of interest: REDIS, NOSQL,
Engineering, Entrepreneurs, Open-Source
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. 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. 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
12. Data structures
Keys are strings which identify pieces of data
(values)
Values can be strings, integers, hashes, lists,
sets, or sorted sets
Various atomic operations (push, pop, add,
read, set, etc.) – after all REDIS is single-
threaded
12
16. Master-Master Replication
Native Redis Master-Master replication doesn’t
exist yet, slated for release end of year
Solution using Apache Zookeeper (
http://zookeeper.apache.org/)
Checks for status using BLPOP
Will promote a slave to master
17. When Not to Use Redis
Data is larger than memory
Need ACID requirements
Big data
18. Security Concerns
It is designed to be used only inside trusted
environment (kind of like MongoDB)
Basic password authentication (but it’s sent in
cleartext)
No data encryption support
18
19. Security Recommendations
Configure firewall to block inbound access on
REDIS ports
Don’t run REDIS server as root, and harden the
server it’s on
Don’t store sensitive data in there.
19
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. Real-time Analytics
Communicate from hydrating application
NodeJS listens to Redis and transmits data
to a page using Socket.IO
Historical data is stored in Redis
Pub/Sub is used to notify listening sockets
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 : jobs@cinchcast.com
compensation + stock options.
Editor's Notes
Contents in http://antirez.com/post/redis-manifesto.html Introduction to Redis Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. You can run atomic operations on these types, like 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. In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log. Redis also supports trivial-to-setup master-slave replication, with very fast non-blocking first synchronization, auto-reconnection on net split and so forth. Other features include a simple check-and-set mechanism, pub/sub and configuration settings to make Redis behave like a cache. You can use Redis from most programming languages out there. Redis is written in ANSI C and works in most POSIX systems like Linux, *BSD, OS X and Solaris without external dependencies. There is no official support for Windows builds, although you may have some options.
This perfect example is illustrated by the dialog between Redis (antirez) and memcached (dormando) developers. antirez 1 - On Redis, Memcached, Speed, Benchmarks and The Toilet dormando - Redis VS Memcached (slightly better bench) antirez 2 - An update on the Memcached/Redis benchmark You can see that in the end, the difference between the two solutions is not so staggering, once all technical aspects are considered. Please note both Redis and memcached have been optimized further after these benchmarks ... Finally, when very efficient servers are benchmarked (and stores like Redis or memcached definitely fall in this category), it may be difficult to saturate the server. Sometimes, the performance bottleneck is on client side, and not server-side. In that case, the client (i.e. the benchmark program itself) must be fixed, or perhaps scaled out, in order to reach the maximum throughput.
And many others: Superfeedr Vidiowiki Wish Internet Consulting Ruby Minds Boxcar Zoombu Dark Curse OKNOtizie Moodstocks uses Redis as its main database by means of Ohm . Favstar Heywatch Sharpcloud Wooga for the games "Happy Hospital" and "Monster World" . Sina Weibo Engage PoraOra Leatherbound AuthorityLabs Fotolog TheMatchFixer Check-Host describes their architecture here . ShopSquad localshow.tv PennyAce Nasza Klasa Forrst Surfingbird