<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Malachi blog]]></title><description><![CDATA[Malachi blog]]></description><link>https://malachihq.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b0862f062f541369b615b06/64e2126e-0e65-4d32-9fe6-8803e7760b55.png</url><title>Malachi blog</title><link>https://malachihq.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 22:31:29 GMT</lastBuildDate><atom:link href="https://malachihq.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Introducing Malachi, an open source log broker in Elixir]]></title><description><![CDATA[Malachi is an open source log broker in Elixir whose topics change shape without breaking their clients, and every release publishes the evidence behind…]]></description><link>https://malachihq.hashnode.dev/introducing-malachi-an-open-source-log-broker-in-elixir</link><guid isPermaLink="true">https://malachihq.hashnode.dev/introducing-malachi-an-open-source-log-broker-in-elixir</guid><category><![CDATA[Elixir]]></category><category><![CDATA[distributed system]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[kafka]]></category><dc:creator><![CDATA[Hector Cardoso]]></dc:creator><pubDate>Thu, 26 Nov 2026 16:56:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0862f062f541369b615b06/f238fecb-5789-45c9-9851-6876176fccfa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Some systems cannot afford to lose a <a href="https://en.wikipedia.org/wiki/Record_(computer_science)">record</a>, or to deliver one twice: a payment, an order, an <a href="https://en.wikipedia.org/wiki/Audit_trail">audit trail</a>. They need a log that keeps every write it acknowledged while <a href="https://en.wikipedia.org/wiki/Fault_tolerance">nodes fail</a>, disks fill up and the data outgrows the layout it started with.</p>
<p><a href="https://github.com/malachi-hq/malachi">Malachi</a> is an <a href="https://en.wikipedia.org/wiki/Open-source_software">open source</a><a href="https://en.wikipedia.org/wiki/Message_broker">log broker</a> built for that. It is written in <a href="https://elixir-lang.org/">Elixir</a> and runs on the <a href="https://www.erlang.org/blog/a-brief-beam-primer/">BEAM</a>, the virtual machine of <a href="https://www.erlang.org/">Erlang/OTP</a>, and it is an independent implementation inspired by the public design of <a href="https://en.wikipedia.org/wiki/LinkedIn">LinkedIn</a>'s <a href="https://www.linkedin.com/blog/engineering/infrastructure/introducing-northguard-and-xinfra">NorthGuard</a> log storage. It is not affiliated with or endorsed by LinkedIn. This post introduces Malachi as it is in v0.28.4.</p>
<h2>A log that can change shape</h2>
<p>In most log brokers a <a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern">topic</a> is cut into a fixed number of <a href="https://kafka.apache.org/documentation/#intro_concepts_and_terms">partitions</a>, and that number decides where every <a href="https://en.wikipedia.org/wiki/Partition_(database)">key</a> lands. Growing a topic means moving keys, and the <a href="https://en.wikipedia.org/wiki/Client_(computing)">clients</a> notice.</p>
<p>A Malachi client deals in three things: a topic, a key and a <a href="https://malachi-hq.github.io/malachi/log-model.html">position</a>. Under the hood a topic is a set of <a href="https://malachi-hq.github.io/malachi/log-model.html">ranges</a>, slices of its <a href="https://en.wikipedia.org/wiki/Shard_(database_architecture)">keyspace</a>, and an operator <a href="https://malachi-hq.github.io/malachi/clustering-and-resharding.html">splits and merges them</a> while <a href="https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem">producers</a> keep writing. A <a href="https://kafka.apache.org/documentation/#intro_concepts_and_terms">consumer</a>'s position is an <a href="https://malachi-hq.github.io/malachi/produce-and-consume.html">opaque token</a>, and after a split the new ranges accept the tokens of the range they came from, so a consumer resumes where it was. It may read its share of the parent's records again, <a href="https://kafka.apache.org/documentation/#semantics">at least once</a>, and it never loses one.</p>
<img src="https://malachi-hq.github.io/malachi/blog/2026-11-25-introducing-malachi/range-split.png" alt="A range A splits into ranges B and C while producers keep writing; a consumer's token in A is accepted by both" style="display:block;margin:0 auto" />

<h2>What an acknowledgement means</h2>
<p>Each range is a series of <a href="https://malachi-hq.github.io/malachi/log-model.html">segments</a>, and each segment is <a href="https://en.wikipedia.org/wiki/Replication_(computing)">replicated</a> across nodes. A write is acknowledged once a <a href="https://en.wikipedia.org/wiki/Quorum_(distributed_computing)">majority</a> of its segment's replicas has written it to disk with <a href="https://man7.org/linux/man-pages/man2/fsync.2.html">fsync</a>. The <a href="https://en.wikipedia.org/wiki/Metadata">metadata</a>, which topics and ranges exist and where their segments live, is replicated by <a href="https://raft.github.io/">Raft</a>. Membership uses <a href="https://www.cs.cornell.edu/projects/Quicksilver/public_pdfs/SWIM.pdf">SWIM</a>, placement is rack-aware, and the cluster repairs the replicas it finds missing.</p>
<img src="https://malachi-hq.github.io/malachi/blog/2026-11-25-introducing-malachi/acknowledgement.png" alt="A producer's write reaches the segment's primary and two replicas, and is acknowledged once two of the three have fsynced it" style="display:block;margin:0 auto" />

<p>Security is on by default: <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a>, with <a href="https://malachi-hq.github.io/malachi/authentication.html">mTLS for clients</a>, <a href="https://openid.net/developers/how-connect-works/">OIDC</a> sign-in and <a href="https://malachi-hq.github.io/malachi/per-topic-acls.html">access control per topic</a>.</p>
<h2>Evidence with every release</h2>
<p>A claim about <a href="https://en.wikipedia.org/wiki/Durability_(database_systems)">durability</a> is worth the test behind it. Every release of Malachi ships with:</p>
<ul>
<li><a href="https://malachi-hq.github.io/malachi/running-chaos-drills.html">chaos drills</a> that kill nodes, break storage and roll out bad configurations, then check that every acknowledged write is still there;</li>
<li><a href="https://en.wikipedia.org/wiki/Load_testing">load tests</a> run on the release's exact code, published with the hardware they ran on and the noise between runs;</li>
<li>a <a href="https://github.com/malachi-hq/malachi/blob/main/CHANGELOG.md">changelog</a> and upgrade notes.</li>
</ul>
<img src="https://malachi-hq.github.io/malachi/blog/2026-11-25-introducing-malachi/release-evidence.png" alt="Each release feeds chaos drills, load tests and its changelog, and their results are published with it" style="display:block;margin:0 auto" />

<p>The results of every run are published beside the code, in the <a href="https://github.com/malachi-hq/malachi/blob/main/benchmark/README.md">benchmark results</a>.</p>
<h2>Where it stands</h2>
<p>Malachi is in active development and is not production-ready. Its interfaces and on-disk formats can still change, it has not been tested at scale, and it makes no stability guarantee yet. It is ready to learn from and to experiment with. What comes next is on the <a href="https://github.com/orgs/malachi-hq/projects/1">project board</a>.</p>
<h2>Try it</h2>
<p>One node on your machine, with <a href="https://www.docker.com/">Docker</a>:</p>
<pre><code class="language-bash">docker run --name malachi \
  -p 127.0.0.1:4040:4040 -p 127.0.0.1:4041:4041 \
  -e MALACHI_ADMIN_PASS=your_secure_password \
  -e MALACHI_REQUIRE_TLS=false \
  -e MALACHI_ADVERTISED_HOST=127.0.0.1 \
  hectorcardoso/malachi:latest
</code></pre>
<p>It serves <a href="https://en.wikipedia.org/wiki/Plaintext">plaintext</a> on <a href="https://en.wikipedia.org/wiki/Localhost">localhost</a> only, which is why TLS is turned off there. The <a href="https://malachi-hq.github.io/malachi/introduction.html">documentation</a> covers <a href="https://en.wikipedia.org/wiki/Computer_cluster">clusters</a>, TLS and the client protocol, and the code is on <a href="https://github.com/malachi-hq/malachi">GitHub</a>, <a href="https://github.com/malachi-hq/malachi/blob/main/LICENSE">MIT licensed</a>. Issues labelled <a href="https://github.com/malachi-hq/malachi/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22">good first issue</a> are a place to start contributing.</p>
<h2>Follow along</h2>
<p>New posts arrive with each release: subscribe to the <a href="https://malachi-hq.github.io/malachi/blog/index.html#newsletter-title">newsletter</a> on the blog, follow the <a href="https://malachi-hq.github.io/malachi/blog/feed.xml">Atom feed</a> or the <a href="https://www.linkedin.com/company/malachi-hq">Malachi page on LinkedIn</a>.</p>
]]></content:encoded></item></channel></rss>