6 ms·
One problem with Redis is that it looks superficially simple, but actually, like any tool used in critical contexts, there are two possibilities: 1) Know how it
by antirez 10y ago
One problem with Redis is that it looks superficially simple, but actually, like any tool used in critical contexts, there are two possibilities: 1) Know how it works very well and do great things with it. 2) Don't understand it properly and find yourself in big troubles soon or later. Because Redis, in order to provide the good things it provides, has, on one side, a set of limitations, and on the other side is strictly coupled with a number of things related to the operating system, tradeoffs in the configuration and so forth.
Certain things I understood over the years that made it better are, of course, improvements in the implementation, but especially things like LATENCY DOCTOR and MEMORY DOCTOR (this one only for versions >= 4.0), that is, most of the things a Redis operations expert can tell you, Redis can tell you directly... without any other help, just observing its internal behavior.
There is another aspect. For a long time I believed a Redis book was not really needed. Now I changed my mind, and I see no good enough Redis book out there, and I'm almost planning writing one... I was writing for a long time, incrementally, a C book, that is currently just an incomplete draft. I'm thinking about abandoning for now this project, and start with a Redis book.
- deleted 10y ago[deleted]
- spenuke 10y agoI for one would be interested in seeing the C book even in draft. :)
- aequitas 10y agoAs with many things, it's not the solution thats complex, the problem is. A seemingly simple solution to a hard problem often just shifts the problem to a different domain for you to deal with it. Understanding your problem and the tools as you mentioned deeply allow the great things, or just, keep fingers crossed and hope for the best. A lot of problems can often be reduced in complexity by really understanding what you need vs. what you think you want or your user wants. The real challenge is translating what is wanted into what is needed (which is often hard to explain to clients).
- jarpineh 10y agoPlease, do consider writing the C book as well. Most publishers have beta programs these days (O'Reilly, Manning, Pragmatic Programmers). Don't leave it in a desk drawer (so to speak). Perhaps simplified Redis example could work as a good base to learn C. Single threaded, memory only persistence, network communication service so no complex stuff like concurrency and file management. Though there's probably a lot more going on in there... Perhaps "Redis for devops" is another book waiting to happen, or how to write Redis modules. By the way, Manning's book (from 2013) is freely available these days: https://redislabs.com/resources/ebook/ https://redislabs.com/resources/ebook/
- antirez 10y agoYep I don't want to abandon the C book... Since is already halfway and is something more general and long lasting than Redis probably. The book indeed has certain Redis internals examples, but isolated so that you don't need to understand the Redis code base.
- jamiesonbecker 10y agoI would also love to read a C book by @antirez! It'd go up there next to my K&R.* I think a redis book is good, but your docs and blog articles are already excellent. If you combined them into a single document (slightly updated or curated blog articles as chapters, with the second half of the book as reference section/appendix for redis.io commands) then your book is done. You could probably even just hire someone to handle this formatting. The C book sounds really fantastic. * (btw, antirez wrote redis.)
- btilly 10y agoThe biggest lesson that I think that most need is that Redis is a very sharp knife. It is perfect for some problems, and a horrible fit for others. Understanding what it is for is critical to having it work out well for you.
- antirez 10y agoExactly, but the use cases for it cannot be easily put into obviously delimited things. There are use cases where Redis is a good fit as a primary database, and use cases where it should not be used even if data is ephemeral, to make an example. The right applications depend on the exact problem, and even problems that are not a fit can be re-stated so that they become good enough for Redis, and similarly, problems that in theory are a great fit can be mis-implemented easily. As I said IMHO it's a matter of understanding how Redis works exactly... in order to make great choices both in applying it or not, and how to apply it.
- btilly 10y agoHere is my understanding. Redis pushes the limit of what can be accomplished using a single-threaded in memory data store. If your processing can be done by such a thing, Redis is probably the most efficient option available. (With, of course, persistence, replication, and so on for managing your data.) But if you throw blocking operations or too much data at it, Redis is going to demonstrate the inherent limitations that come with being a single-threaded in memory data store.
- misterbowfinger 10y agoJust curious - what's an example where Redis is a good fit as a primary database?
- kakapupu 10y ago> The right applications depend on the exact problem, and even problems that are not a fit can be re-stated so that they become good enough for Redis, and similarly, problems that in theory are a great fit can be mis-implemented easily How about adding something about this in the documentation, if you haven't already? - Do use Redis for <X> - Do NOT use Redis for <Y>
- Pfiffer 10y agoI personally would love a C book.
- andygrunwald 10y agoOriginal author here. First of all, thank you antirez for this beautiful piece of software. And i agree you 100%. At the first glance it looks simple. Later if you use it, it can get a beast very fast. But after you get some more knowledge about this, you know how to deal with it. What i really like is your approach you mentioned: "Over the last years i learned...". And the users of redis can feel this. More and more commands and tools are implemented in redis that makes handling of bigger envs way easier or tools to speed up your debugging sessions like WATCHDOG, SLOWLOG, latency based testing (as mentioned in the article). Don't get me wrong. This article is not about blaming redis. I and we as a company, love redis. Thank you.
- dotancohen 10y agoHi, Salvatore. I was actually just recently deciding how to contact you as I saw an earlier comment of yours about wanting to switch you site over to Markdown. Obviously I've benefited from your work on Redis, so if you'd like a hand converting the site over to Markdown or with the books (proofreading, technical editing) I'm happy to help. Let me know!
- dpeck 10y agoA Redis book in the same vein as Erlang in Anger, would be greatly received and appreciated by all.
- esterly 10y agoRedis is one of the most reliable pieces of software we have used. We ran it in the debugger in our staging environment for 2years hoping to supply a good bug report years ago. Zero crashes to report on in two years under cache and analytics load. Please write the book, I have always appreciated your writing.
- SmellTheGlove 10y ago> One problem with Redis is that it looks superficially simple, but actually, like any tool used in critical contexts ... Definitely. And on top of that, Redis is very easy to get started with, and as the article illustrates, you can plug along very smoothly until you suddenly find a mountain to climb. Shouldn't scare someone off, but one of the lessons is to understand what you're implementing and where the bottlenecks will eventually be - much easier said than done, in my experience, but something to aim for.
- atxcrab 10y agoRedis code is poetry in c. Please don't abandon c book