background preloader

Redis

Facebook Twitter

Building a Redis Sentinel Client for Node.js - DocuSign Dev Blog. We use Redis for sessions and for a short-lived data cache in our node.js application.

Building a Redis Sentinel Client for Node.js - DocuSign Dev Blog

Like any component in the system, there’s a potential risk of failure, and graceful failover to a “slave” instance is a way to mitigate the impact. We use Redis Sentinel to help manage this failover process. As the docs describe, Redis Sentinel is a distributed system, this means that usually you want to run multiple Sentinel processes across your infrastructure, and this processes will use agreement protocols in order to understand if a master is down and to perform the failover. Essentially, each node server has its own sentinel corresponding to each redis cluster [master and slave(s)] that it connects to. The sentinel is not a proxy - the connection to the sentinel doesn’t replace the connecton to the master - it’s a separate instance with the sole purpose of managing master/slave availability. Snappy Dashboards with Redis - ToGo. It seems that almost every application I’ve worked on has some sort of dashboard component.

Snappy Dashboards with Redis - ToGo

It’s not usually the first feature but it often becomes the most useful. Dashboards are great because they tell you a little bit about everything. But dashboards are hard to build. They break resource-oriented design patterns and often rely on complicated one-off SQL queries. Dashboards also usually feature graphs and activity streams, both of which are not trivial to implement well. At Sqoot, a local deal API, we have a simple dashboard for our customers. All of these stats follow a pretty standard query pattern: This works great for small collections or well-indexed relational tables. So we developed another way to store the counts we need. For every stat we’re interested in, we set a few keys: The first three keys tell us totals for all users by year, month, and day.

You can also query across date ranges with the help of some Ruby: A guest post by Avand Amiri co-founder of Sqoot. Should I use MongoDB, CouchDB, or Redis? In the current nosql fervor, there is an important distinction that seems to get missed repeatedly.

Should I use MongoDB, CouchDB, or Redis?

There are two (OK three) really important factors that these tools use to distinguish themselves and many people completely miss the point. The first factor is durability -- does the data actually get saved to a disk somewhere and, if so, how often and how much might I lose if something "goes wrong"? Redis and mongodb users might be somewhat surprised to learn that, by default, they can lose your data should the process crash or shut down. While you can configure them to work around this issue, you're going to slow things down substantially doing so and therefore lose the big advantage they've been designed to provide.

Technique

DataTypes. Some Notes on Distributed Key Stores « random($foo) Last week I ended up building a distributed keystore for a client.

Some Notes on Distributed Key Stores « random($foo)

That wasn’t my original intention, but after doing testing on just about every project out there, it turned out to be the best (only?) Solution for our needs. Specifically, a production environment handling at least 100M items with an accelerating growth curve, very low latency retrievals, and the ability to handle 100s of inserts/s w/ variable-sized data (avg 1K, but up in many cases well beyond) … on EC2 hardware. The previous system had been using S3 (since SDB is limited to 1K values) – err, the lesson there, BTW is don’t do that. So, these requirements are decent – something that actually requires a distributed system, but something that shouldn’t be beyond what can be handled by a few nodes. I’m still catching up on a number of other projects, so I don’t have a great deal of time to do a formal writeup, hoewver, the work I’ve done may be useful for those who might actually need to implement a production keystore. Redis - Project Hosting on Google Code. Redback - A high-level Redis library for Node.JS.