The unhappy outcome of Redis’ approach to security (“it’s totally insecure to let untrusted clients access the system, please protect it from the outside world yourself” [source]), its historical defaults (bind 0.0.0.0
) and the non-RTFMness of most (if not all) of us is the existence of too many unprotected servers that are open to the entire world.
While newer versions bind to the loopback interface by default, this alone still isn’t quite enough to protect against accidentally leaving the door open because most deployments will override this configuration setting (Redis is, after all, a REmote [DIctionary] Server). To overcome this, protected-mode
is a compromise that changes very little of the current behavior but requires twice the effort to become exposed to risks. However, since it does break existing deployments, it will not be backported to earlier versions.
ZeroBrane Studio is THE Lua IDE for me: it is open source, lightweight, cross-platform, portable, rock stable and passionately maintained by Paul Kulchenko @zerobrane. It also boasts a very handy integrated debugger that now, thanks to Paul’s work and Redis’ sponsorship, plays very nicely with Redis’ LDB. Check out the screencast for an introduction, or follow these steps to get to Lua debugging heaven:
- Download, install and start an LDB-enabled Redis server (right now, that’s the release candidate for v3.2).
- Download and install ZeroBrane Studio v1.20 or above – the project is entirely free but if you benefit from using it, please consider supporting it.
- Get yourself the ZeroBrane Studio interpreter plugin for Redis from the ZeroBranePackage repository, aptly named redis.lua.
- To install the plugin for all users, drop it in the packages directory of your ZeroBrane Studio installation (e.g.
/opt/zbstudio/packages/
), or put it in your ~/.zbstudio/packages
directory to savor it alone.
OH Redsmin {Redis GUI} @redsmin > Looking for an easy way to use #Redis LUA scripting? Well, it’s now integrated in Redsmin. Next step: the debugger!
A nice example/introduction of/to Redis’ Lua from Dan Young @danoyoung, who shows how to move some crunching server-side. Useful when faced with fuzzy requirements and the need for fast prototyping, but also valid as an approach for long-term performance optimizations.
The Why? and How? of storing and querying time series data in Redis by Josiah Carlson @dr_josiah via @InfoQ. The ideas are clearly explained and are accompanied, as per usual with the good doctor, with runnable (#Python
) code to put you immediately on the right track. Find the time to internalize and assimilate this knowledge.
About 1.1589 Sol years (or 423 days) after git init
, Redis’ little brother (or is it a sister?) makes a formal debut with its first release candidate – an in-memory, distributed job queue/message broker by Salvatore Sanfilippo @antirez that supports both at-least-once as well as at-most-once message delivery semantics and makes the best attempt to keep messages order.
OH Mathias Verraes @mathiasverraes > There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery
“We want to be as real-time as possible…which gives us a convenient excuse to use Redis.” – this quote alone is convenient excuse for a reference 🙂 Marios @papercruncher‘s explains how an ad-serving system was optimized to tackle the multi-armed bandit problem in real time.
Quentin Donnellan @qdonnellan tells how @SpiderOak decided to build their own analytics solution despite his own brother’s advice. The end result features two of Redis’ popular use cases – firstly it is an event ingestion buffer in front of #PostgreSQL
, from which the data is periodically scraped and stored. Secondly, after ETLing, it stores and serves the snappy data that’s needed for the dashboards. Hey, Quentin, can you share more of the details?
Daniele Teti @danieleteti made a Redis client for a language/platform that I believed (with no apparent basis) had long passed from this veil of tears. I wonder whether #TurboPascal
is still used out there…
After an hiatus, Kyle Davis @stockholmux‘s back with a short 17th post that whirls through turning Redis into imgur. Aptly opens with “With Redis, you think small”. Ends with “so many possibilities.” #CliffHanger
Speaking of the Davis and until Redis boasts a first-order Bloom Filter data structure, Kyle Davis @stockholmux shows how you can still magic your way with a little help from #NodeJS
.
Hailed by its very own author Zihua Li @luinlee as beautiful and easy-to-use, Medis @medisclient is a local MacOSX-only-but-soon™-for-Linux-and-Windows client that does look pretty and simple. Bonus points for scoping-out KEYS
and the built-in JSON/MessagePack parsers, but OTOH not every one uses an Apple and the lack of cluster support leave a lot of room for improvement.
Nikolay Bondarenko @misterionkell keeps his blog fresh with two new articles that dig deep into Redis’ data structures. If you like them #InfernalInternals
or just want to broaden your understanding of Redis’ inner workings, that’s where you should [rh]ead next.
Complementing the item above, Vaibhaw Pandey @_Vaibhaw from the MongoDB hosting service MongoDirector.com gives his insights about Redis’ Hashes and introduces (at least to me) another meaning the most confounding acronym CAS.
Discussion: /r/redis
A cache aside implementation using Redis combined with an in-heap “L1” cache by Harald S. Ulriksen @hsulriksen – recommended pattern for pracachetioners regardless of their choice of language.
And while on the topic of caching and patterns, I really appreciate the elegance in wrapping function caching and locking with decorators – by Jonathan Ong @jongleberry.
“Throwing Redis at all my problems” by Peter Bui @paydro from @8tracks remembers how he once forked Redis and changed it to do his bidding (namely, expiry on slaves) so he can offload an expensive operation (set intersection) from the master. Because open source, duh. AFAIR this wasn’t discussed/PRed in the community, so now that the fork is abandonware it is of little value, which is a shame. The cluster, however, alleviates the need to use slaves for horizontal scaling so nowadays instead of forking you can just shard it.
This effective script from @NetflixOSS‘s Dynomite “heals” fragmentation by persisting the data, restarting the instance and repeating if needed.
Sachin Joglekar @joglekareshwar explains the foundations that for reactive programming (#MSExcel
:)) and shows how to accomplish that in #Python
‘s #Django
.
OH Chris LoPresto @chrislopresto > redis is fantastic. I’d serve dinner from it if I could.
Jay Johnson @jayphjohnson maintains two swarm flavors for a highly-available Redis deployments – w/ and w/o #HAProxy
. Both flavors employ Redis Sentinel and Supervisor to watch over the Redis instances. #PretAPorter
This not-really-Azure-specific repository from Marc Gagné @marc_gagne extends the basic chat example from Socket IO @SocketIO to create its distributed equivalent. Multiple web socket servers are employed for scale and have messages relayed to them via a Redis PubSub channel.
Blog post: How to scale your web socket server (WSS) using Redis Cache