4 ms·
Under what circumstances would one prefer Redis streams over Kafka and vice versa?
by hyades 9y ago
Under what circumstances would one prefer Redis streams over Kafka and vice versa?
- zedpm 9y agoOne that immediately comes to mind is cases where Kafka is overkill. Kafka is a great tool, but there's a lot of overhead in setting up and maintaining it (e.g. Zookeeper), so if your throughput needs are low, it's a poor fit. Spinning up a Redis server is dead simple, and if you're already using Redis for other things, then there's no need to bring an additional tool into the mix.
- chicagobuss 9y agoGenuine question - Why does everyone seem to think running a zookeeper cluster is so hard? You can run it on three small VMs and basically forget about it. We didn't have any zookeeper experience at my last startup before we started using it for Kafka and we used a very simple puppet module to install it on three instances in each of our AWS regions. It really never gave us many problems in the several years since. Also, all the tooling around it is quite mature - there are great monitoring and management tools for probing at the internals which helped when we were dealing with more exotic kafka surgery.
- hueving 9y agoBecause nothing in the current hype cycle depends on zookeeper so people use that as a crutch for following hype.
- takeda 9y agoFor some reason Zookeeper is unjustly seem as uncool technology. I even seen it being blamed for issues that it had nothing to do with. People say that setting ZK cluster is a huge issue, yet they don't see a problem spinning etcd, or sentry nodes in case of redis. When I learned about ZK I was skeptic, didn't like that it was written in Java, but ZK proved to be extremely robust.
- zedpm 9y agoI'm not sure about it being "so hard", but it's extra stuff to deploy, maintain, monitor, and pay for. Very small teams benefit from keeping things small and simple. Again, if you actually need Kafka, then it's worth it. If you just need something similar, but can deal with the limitations of redis streams, then it's an easy choice.
- agacera 9y agoI can think in some circumtances: 1 - You already have a Redis infrastructure and don't wanna or don't have resources to deploy a full Kafka infrastructure (3 kafka brokers + 3 zookeeper nodes) 2 - Kafka clients are not available (or are poorly available) for every programming language. Redis has a simpler protocol, so it has more/and better clients available and even if you use an exotic language, it is easy to write a client to it (well... easier than Kafka) 3 - Kafka AFAIK does not have any internal cache implementation, so every read is served from disk (+ page cache). This means that Redis Streams will (probably) perform much better for use cases when the consumers need to fetch data from old offsets. edit: added reason number 3.
- chicagobuss 9y agore: client support - I dunno, this seems like a pretty comprehensive list to me? I mean, there's even a rust client: https://cwiki.apache.org/confluence/display/KAFKA/Clients https://cwiki.apache.org/confluence/display/KAFKA/Clients
- agacera 9y agoConfluent only officially supports the Java client (and now has a Python, Go and .Net clients as well that I didn't know) and it is really recommended to use the client with the same version of broker due to protocol incompatibilities. Most Kafka client implementations are open-source projects of their own, this is also true for most redis clients implementations, but again: Kafka protocol is much more complicated than Redis. I haven't used Kafka with other languages besides Java or Scala, so I can't really say how mature are the other clients. But my point about how easy is to implement a client for Redis if needed is still valid. =)
- kasey_junk 9y agoThey also support a c reference implementation (which is how they get others).
- omni 9y agoAs someone who has been burned by non-Java Kafka drivers, beware the perception of ecosystem support here. The Kafka design pushes a huge amount of complexity onto the client, and in our experience only the Java client deals with this complexity well. We started out using Python clients but eventually moved to Confluent's REST API (wrapping the Java driver) because we had so many problems with it.
- manigandham 9y agoSimplicity. Redis 4.0 with the rxlists module [1] provides a fast queue system with full persistence. Unless you need replay, Redis is often easier and has plenty of throughput. This streams feature now solves the replay disadvantage. 1. http://redismodules.com/modules/rxlists/ http://redismodules.com/modules/rxlists/