<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Kafka on Brave New Geek</title><link>https://bravenewgeek.com/tag/kafka/</link><description>Recent content in Kafka on Brave New Geek</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 29 Oct 2020 15:05:18 -0500</lastBuildDate><atom:link href="https://bravenewgeek.com/tag/kafka/index.xml" rel="self" type="application/rss+xml"/><item><title>Introducing Liftbridge: Lightweight, Fault-Tolerant Message Streams</title><link>https://bravenewgeek.com/introducing-liftbridge-lightweight-fault-tolerant-message-streams/</link><pubDate>Fri, 27 Jul 2018 17:42:49 -0500</pubDate><guid>https://bravenewgeek.com/introducing-liftbridge-lightweight-fault-tolerant-message-streams/</guid><description>&lt;p&gt;&lt;a href="https://github.com/liftbridge-io/liftbridge"&gt;&lt;img loading="lazy" src="https://bravenewgeek.com/wp-content/uploads/2018/07/liftbridge.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/tyler_treat/status/1019281381493526529"&gt;Last week&lt;/a&gt; I open sourced &lt;a href="https://github.com/liftbridge-io/liftbridge"&gt;Liftbridge&lt;/a&gt;, my latest project and contribution to the &lt;a href="https://www.cncf.io/"&gt;Cloud Native Computing Foundation&lt;/a&gt; ecosystem. Liftbridge is a system for lightweight, fault-tolerant (LIFT) message streams built on &lt;a href="https://nats.io/"&gt;NATS&lt;/a&gt; and &lt;a href="https://grpc.io/"&gt;gRPC&lt;/a&gt;. Fundamentally, it extends NATS with a &lt;a href="https://kafka.apache.org/"&gt;Kafka&lt;/a&gt;-like publish-subscribe log API that is highly available and horizontally scalable.&lt;/p&gt;
&lt;p&gt;I’ve been working on Liftbridge for the past couple of months, but it’s something I’ve been thinking about for over a year. I sketched out the design for it last year and &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-5-sketching-a-new-system/"&gt;wrote about it&lt;/a&gt; in January. It was largely inspired while I was working on &lt;a href="https://github.com/nats-io/nats-streaming-server"&gt;NATS Streaming&lt;/a&gt;, which I’m currently still the second top contributor to. My primary involvement with NATS Streaming was building out the early data replication and clustering solution for high availability, which has continued to evolve since I left the project. In many ways, Liftbridge is about applying a lot of the things I learned while working on NATS Streaming as well as my observations from being closely involved with the NATS community for some time. It’s also the product of scratching an itch I’ve had since these are the kinds of problems I enjoy working on, and I needed something to code.&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 5: Sketching a New System</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-5-sketching-a-new-system/</link><pubDate>Tue, 23 Jan 2018 12:08:53 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-5-sketching-a-new-system/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-4-trade-offs-and-lessons-learned/"&gt;part four&lt;/a&gt; of this series we looked at some key trade-offs involved with a distributed log implementation and discussed a few lessons learned while building NATS Streaming. In this fifth and final installment, we’ll conclude by outlining the design for a new log-based system that draws from the previous entries in the series.&lt;/p&gt;
&lt;h3 id="the-context"&gt;The Context&lt;/h3&gt;
&lt;p&gt;For context, &lt;a href="https://nats.io/"&gt;NATS&lt;/a&gt; and &lt;a href="https://nats.io/documentation/streaming/nats-streaming-intro/"&gt;NATS Streaming&lt;/a&gt; are two different things. NATS Streaming is a log-based streaming system built on top of NATS, and NATS is a lightweight pub/sub messaging system. NATS was originally built (and then open sourced) as the control plane for Cloud Foundry. NATS Streaming was built in response to the community’s ask for higher-level guarantees—durability, at-least-once delivery, and so forth—beyond what NATS provided. It was built as a separate layer on top of NATS. I tend to describe NATS as a dial tone—ubiquitous and always on—perfect for “online” communications. NATS Streaming is the voicemail—leave a message after the beep and someone will get to it later. There are, of course, more nuances than this, but that’s the gist.&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 4: Trade-Offs and Lessons Learned</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-4-trade-offs-and-lessons-learned/</link><pubDate>Thu, 18 Jan 2018 16:01:13 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-4-trade-offs-and-lessons-learned/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-3-scaling-message-delivery/"&gt;part three&lt;/a&gt; of this series we talked about scaling message delivery in a distributed log. In part four, we’ll look at some key trade-offs involved with such systems and discuss a few lessons learned while building NATS Streaming.&lt;/p&gt;
&lt;h3 id="competing-goals"&gt;Competing Goals&lt;/h3&gt;
&lt;p&gt;There are a number of competing goals when building a distributed log (these goals also extend to many other types of systems). Recall from &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/"&gt;part one&lt;/a&gt; that our key priorities for this type of system are performance, high availability, and scalability. The preceding parts of this series described at various levels how we can accomplish these three goals, but astute readers likely noticed that some of these things conflict with one another.&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 3: Scaling Message Delivery</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-3-scaling-message-delivery/</link><pubDate>Mon, 08 Jan 2018 16:10:40 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-3-scaling-message-delivery/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-2-data-replication/"&gt;part two&lt;/a&gt; of this series we discussed data replication within the context of a distributed log and how it relates to high availability. Next, we’ll look at what it takes to scale the log such that it can handle non-trivial workloads.&lt;/p&gt;
&lt;h3 id="data-scalability"&gt;Data Scalability&lt;/h3&gt;
&lt;p&gt;A key part of scaling any kind of data-intensive system is the ability to partition the data. Partitioning is how we can scale a system linearly, that is to say we can handle more load by adding more nodes. We make the system &lt;em&gt;horizontally&lt;/em&gt; scalable.&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 2: Data Replication</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-2-data-replication/</link><pubDate>Wed, 27 Dec 2017 12:26:55 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-2-data-replication/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/"&gt;part one&lt;/a&gt; of this series we introduced the idea of a message log, touched on why it’s useful, and discussed the storage mechanics behind it. In part two, we discuss data replication.&lt;/p&gt;
&lt;p&gt;We have our log. We know how to write data to it and read it back as well as how data is persisted. The caveat to this is, although we have a durable log, it’s a single point of failure (SPOF). If the machine where the log data is stored dies, we’re SOL. Recall that one of our three priorities with this system is high availability, so the question is how do we achieve high availability and fault tolerance?&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 1: Storage Mechanics</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/</link><pubDate>Thu, 21 Dec 2017 15:54:17 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/</guid><description>&lt;p&gt;The log is a totally-ordered, append-only data structure. It’s a powerful yet simple abstraction—a sequence of immutable events. It’s something that programmers have been using for a very long time, perhaps without even realizing it because it’s so simple. Whether it’s application logs, system logs, or access logs, logging is something every developer uses on a daily basis. Essentially, it’s a timestamp and an event, a &lt;em&gt;when&lt;/em&gt; and a &lt;em&gt;what&lt;/em&gt;, and typically appended to the end of a file. But when we generalize that pattern, we end up with something much more useful for a broad range of problems. It becomes more interesting when we look at the log not just as a system of record but a central piece in managing data and distributing it across the enterprise efficiently.&lt;/p&gt;</description></item><item><title>FIFO, Exactly-Once, and Other Costs</title><link>https://bravenewgeek.com/fifo-exactly-once-and-other-costs/</link><pubDate>Wed, 02 Aug 2017 10:14:20 -0500</pubDate><guid>https://bravenewgeek.com/fifo-exactly-once-and-other-costs/</guid><description>&lt;p&gt;There’s been &lt;a href="https://bravenewgeek.com/you-cannot-have-exactly-once-delivery-redux/"&gt;a lot&lt;/a&gt; &lt;a href="http://the-paper-trail.org/blog/exactly-not-atomic-broadcast-still-impossible-kafka/"&gt;of discussion&lt;/a&gt; &lt;a href="https://fpj.me/2017/07/04/no-consensus-in-exactly-once/"&gt;about&lt;/a&gt; &lt;a href="http://data.alishoker.com/2017/07/notes-on-exactly-once-semantics-in.html"&gt;exactly-once semantics&lt;/a&gt; &lt;a href="https://medium.com/@jaykreps/exactly-once-one-more-time-901181d592f9"&gt;lately&lt;/a&gt;, sparked by the recent &lt;a href="https://www.confluent.io/blog/exactly-once-semantics-are-possible-heres-how-apache-kafka-does-it/"&gt;announcement&lt;/a&gt; of support for it in Kafka 0.11. I’ve already &lt;a href="https://bravenewgeek.com/what-you-want-is-what-you-dont-understanding-trade-offs-in-distributed-messaging/"&gt;written at length&lt;/a&gt; about strong guarantees in messaging.&lt;/p&gt;
&lt;p&gt;My former coworker Kevin Sookocheff recently made a &lt;a href="https://sookocheff.com/post/messaging/dissecting-sqs-fifo-queues/"&gt;post&lt;/a&gt; about ordered and exactly-once message delivery as it relates to Amazon SQS. It does a good job of illustrating what the trade-offs are, and I want to drive home some points.&lt;/p&gt;
&lt;p&gt;In the article, Kevin shows how FIFO delivery is really only meaningful when you have one single-threaded publisher and one single-threaded receiver. Amazon’s FIFO queues allow you to control how restrictive this requirement is by applying ordering on a per-group basis. In other words, we can improve throughput if we can partition work into different ordered groups rather than a single totally ordered group. However, FIFO still effectively limits throughput on a group to a single publisher and single subscriber. If there are multiple publishers, they have to coordinate to ensure ordering is preserved with respect to our application’s semantics. On the subscriber side, things are simpler because SQS will only deliver messages in a group one at a time in order amongst subscribers.&lt;/p&gt;</description></item><item><title>You Cannot Have Exactly-Once Delivery Redux</title><link>https://bravenewgeek.com/you-cannot-have-exactly-once-delivery-redux/</link><pubDate>Fri, 30 Jun 2017 15:43:31 -0500</pubDate><guid>https://bravenewgeek.com/you-cannot-have-exactly-once-delivery-redux/</guid><description>&lt;p&gt;A couple years ago I wrote &lt;a href="https://bravenewgeek.com/you-cannot-have-exactly-once-delivery/"&gt;You Cannot Have Exactly-Once Delivery&lt;/a&gt;. It stirred up quite a bit of discussion and was even &lt;a href="https://twitter.com/tyler_treat/status/849449118405677057"&gt;referenced in a book&lt;/a&gt;, which I found rather surprising considering I’m not exactly an academic. Recently, the topic of exactly-once delivery has again become a &lt;a href="https://segment.com/blog/exactly-once-delivery/"&gt;popular point&lt;/a&gt; &lt;a href="https://bravenewgeek.com/smart-endpoints-dumb-pipes/"&gt;of discussion&lt;/a&gt;, particularly with the &lt;a href="https://www.confluent.io/blog/exactly-once-semantics-are-possible-heres-how-apache-kafka-does-it/"&gt;release of Kafka 0.11&lt;/a&gt;, which introduces support for idempotent producers, transactional writes across multiple partitions, and—wait for it—exactly-once semantics.&lt;/p&gt;
&lt;p&gt;Naturally, when this hit Hacker News, I received a lot of messages from people asking me, “what gives?” There’s literally a TechCrunch headline titled, &lt;a href="https://techcrunch.com/2017/06/30/confluent-achieves-holy-grail-of-exactly-once-delivery-on-kafka-messaging-service/"&gt;&lt;em&gt;Confluent achieves holy grail of “exactly once” delivery on Kafka messaging service&lt;/em&gt;&lt;/a&gt; (Jay assures me, they don’t write the headlines). The myth has been disproved!&lt;/p&gt;</description></item><item><title>Benchmarking Commit Logs</title><link>https://bravenewgeek.com/benchmarking-commit-logs/</link><pubDate>Sun, 27 Nov 2016 13:28:55 -0600</pubDate><guid>https://bravenewgeek.com/benchmarking-commit-logs/</guid><description>&lt;p&gt;In this article, we look at &lt;a href="https://kafka.apache.org/"&gt;Apache Kafka&lt;/a&gt; and &lt;a href="http://nats.io/"&gt;NATS Streaming&lt;/a&gt;, two messaging systems based on the idea of a commit log. We’ll compare some of the features of both but spend less time talking about Kafka since by now it’s quite well known. Similar to &lt;a href="https://bravenewgeek.com/benchmarking-message-queue-latency/"&gt;previous&lt;/a&gt; &lt;a href="https://bravenewgeek.com/dissecting-message-queues/"&gt;studies&lt;/a&gt;, we’ll attempt to quantify their general performance characteristics through careful benchmarking.&lt;/p&gt;
&lt;p&gt;The purpose of this benchmark is to test drive the newly released NATS Streaming system, which was made generally available just in the last few months. NATS Streaming doesn’t yet support clustering, so we try to put its performance into context by looking at a similar configuration of Kafka.&lt;/p&gt;</description></item><item><title>Benchmarking Message Queue Latency</title><link>https://bravenewgeek.com/benchmarking-message-queue-latency/</link><pubDate>Sat, 13 Feb 2016 16:23:39 -0600</pubDate><guid>https://bravenewgeek.com/benchmarking-message-queue-latency/</guid><description>&lt;p&gt;About a year and a half ago, I published &lt;a href="https://bravenewgeek.com/dissecting-message-queues/"&gt;Dissecting Message Queues&lt;/a&gt;, which broke down a few different messaging systems and did some performance benchmarking. It was a naive attempt and had &lt;a href="https://bravenewgeek.com/benchmark-responsibly/"&gt;a lot of problems&lt;/a&gt;, but it was also my first time doing any kind of system benchmarking. It turns out benchmarking systems correctly is actually pretty difficult and many folks get it wrong. I don’t claim to have gotten it right, but over the past year and a half I’ve learned a lot, tried to build some better tools, and improve my methodology.&lt;/p&gt;</description></item><item><title>Dissecting Message Queues</title><link>https://bravenewgeek.com/dissecting-message-queues/</link><pubDate>Mon, 07 Jul 2014 00:33:53 -0500</pubDate><guid>https://bravenewgeek.com/dissecting-message-queues/</guid><description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Disclaimer (10/29/20)&lt;/strong&gt; – The benchmarks and performance analysis presented in this post should not be relied on. This post was written roughly six years ago, and at the time, was just the result of my exploration of various messaging systems. The benchmarks are not implemented in a meaningful way, which I discussed in a &lt;a href="https://bravenewgeek.com/benchmark-responsibly/"&gt;follow-up post&lt;/a&gt;. This post will remain for posterity and learning purposes, but I do not claim that this information is accurate or useful.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>