<?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>Nats on Brave New Geek</title><link>https://bravenewgeek.com/tag/nats/</link><description>Recent content in Nats 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/nats/index.xml" rel="self" type="application/rss+xml"/><item><title>Liftbridge 1.0</title><link>https://bravenewgeek.com/liftbridge-1-0/</link><pubDate>Tue, 28 Apr 2020 13:12:21 -0500</pubDate><guid>https://bravenewgeek.com/liftbridge-1-0/</guid><description>&lt;p&gt;&lt;img loading="lazy" src="https://bravenewgeek.com/wp-content/uploads/2020/04/liftbridge_full-1024x228.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://liftbridge.io"&gt;Liftbridge&lt;/a&gt; has evolved a lot since making the first commit in October 2017, but the vision has remained the same: provide a message-streaming solution with a focus on simplicity and usability. This is demonstrated through many of the design and implementation decisions. A few examples include the use of NATS as the messaging backbone, avoiding heavy dependencies on runtimes like the JVM and external coordination systems like ZooKeeper, compiling down to a small, single static binary, opting for a gRPC-based API, and relying on plain YAML configuration. Liftbridge is written in Go, and the code is structured with the hopes that it’s relatively easy for someone to hop in and contribute to the project.&lt;/p&gt;</description></item><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>Thrift on Steroids: A Tale of Scale and Abstraction</title><link>https://bravenewgeek.com/thrift-on-steroids-a-tale-of-scale-and-abstraction/</link><pubDate>Thu, 30 Nov 2017 19:49:24 -0600</pubDate><guid>https://bravenewgeek.com/thrift-on-steroids-a-tale-of-scale-and-abstraction/</guid><description>&lt;p&gt;&lt;a href="https://thrift.apache.org/"&gt;Apache Thrift&lt;/a&gt; is an RPC framework developed at Facebook for building “scalable cross-language services.” It consists of an interface definition language (IDL), communication protocol, API libraries, and a code generator that allows you to build and evolve services independently and in a polyglot fashion across a wide range of languages. This is nothing new and has been around for over a decade now.&lt;/p&gt;
&lt;p&gt;There are a number of notable users of Thrift aside from Facebook, including Twitter (mainly by way of &lt;a href="https://twitter.github.io/finagle/"&gt;Finagle&lt;/a&gt;), Foursquare, Pinterest, Uber (via &lt;a href="https://uber.github.io/tchannel/"&gt;TChannel&lt;/a&gt;), and Evernote, among others—and for good reason, Thrift is mature and battle-tested.&lt;/p&gt;</description></item><item><title>Smart Endpoints, Dumb Pipes</title><link>https://bravenewgeek.com/smart-endpoints-dumb-pipes/</link><pubDate>Thu, 29 Jun 2017 19:02:46 -0500</pubDate><guid>https://bravenewgeek.com/smart-endpoints-dumb-pipes/</guid><description>&lt;p&gt;I read an interesting article recently called &lt;a href="http://programmingisterrible.com/post/162346490883/how-do-you-cut-a-monolith-in-half"&gt;How do you cut a monolith in half?&lt;/a&gt; There are a lot of thoughts in the article that resonate with me and some that I disagree with, prompting this response.&lt;/p&gt;
&lt;p&gt;The overall message of the article is don’t use a message broker to break apart a monolith because it’s like a cross between a load balancer and a database, with the disadvantages of both and the advantages of neither. The author argues that message brokers are a popular way to pull apart components over a network because they have low setup cost and provide easy service discovery, but they come at a high operational cost. My response to that is the same advice the author puts forward: &lt;em&gt;it depends&lt;/em&gt;.&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>Iris Decentralized Cloud Messaging</title><link>https://bravenewgeek.com/iris-decentralized-cloud-messaging/</link><pubDate>Tue, 22 Jul 2014 22:34:31 -0600</pubDate><guid>https://bravenewgeek.com/iris-decentralized-cloud-messaging/</guid><description>&lt;p&gt;A couple weeks ago, I published a rather extensive &lt;a href="http://www.bravenewgeek.com/dissecting-message-queues/"&gt;analysis&lt;/a&gt; of numerous message queues, both brokered and brokerless. Brokerless messaging is really just another name for peer-to-peer communication. As we saw, the difference in message latency and throughput between peer-to-peer systems and brokered ones is several orders of magnitude. ZeroMQ and nanomsg are able to reliably transmit &lt;em&gt;millions&lt;/em&gt; of messages per second at the expense of guaranteed delivery.&lt;/p&gt;
&lt;p&gt;Peer-to-peer messaging is decentralized, scalable, and fast, but it brings with it an inherent complexity. There is a dichotomy between how brokerless messaging is conceptualized and how distributed systems are actually &lt;em&gt;built&lt;/em&gt;. Distributed systems are composed of services like applications, databases, caches, etc. Services are composed of instances or nodes—individually addressable hosts, either physical or virtual. The key observation is that, conceptually, the unit of interaction lies at the &lt;em&gt;service level&lt;/em&gt;, not the instance level. We don’t care about &lt;em&gt;which&lt;/em&gt; database server we interact with, we just want to talk to &lt;em&gt;a&lt;/em&gt; database server (or perhaps multiple). We’re concerned with logical groups of nodes.&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>