<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hector Cardoso</title>
    <description>The latest articles on DEV Community by Hector Cardoso (@hectorifc).</description>
    <link>https://dev.to/hectorifc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F909931%2Fd15af30f-be12-4d4a-b32e-84c4663a42e5.jpeg</url>
      <title>DEV Community: Hector Cardoso</title>
      <link>https://dev.to/hectorifc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hectorifc"/>
    <language>en</language>
    <item>
      <title>Introducing Malachi, an open source log broker in Elixir</title>
      <dc:creator>Hector Cardoso</dc:creator>
      <pubDate>Wed, 25 Nov 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/hectorifc/introducing-malachi-an-open-source-log-broker-in-elixir-47bc</link>
      <guid>https://dev.to/hectorifc/introducing-malachi-an-open-source-log-broker-in-elixir-47bc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frr2wa5wu77yvohn1o5if.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frr2wa5wu77yvohn1o5if.png" alt="Introducing Malachi, an open source log broker in Elixir" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some systems cannot afford to lose a &lt;a href="https://en.wikipedia.org/wiki/Record_(computer_science)" rel="noopener noreferrer"&gt;record&lt;/a&gt;, or to deliver one twice: a payment, an order, an &lt;a href="https://en.wikipedia.org/wiki/Audit_trail" rel="noopener noreferrer"&gt;audit trail&lt;/a&gt;. They need a log that keeps every write it acknowledged while &lt;a href="https://en.wikipedia.org/wiki/Fault_tolerance" rel="noopener noreferrer"&gt;nodes fail&lt;/a&gt;, disks fill up and the data outgrows the layout it started with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/malachi-hq/malachi" rel="noopener noreferrer"&gt;Malachi&lt;/a&gt; is an &lt;a href="https://en.wikipedia.org/wiki/Open-source_software" rel="noopener noreferrer"&gt;open source&lt;/a&gt;&lt;a href="https://en.wikipedia.org/wiki/Message_broker" rel="noopener noreferrer"&gt;log broker&lt;/a&gt; built for that. It is written in &lt;a href="https://elixir-lang.org/" rel="noopener noreferrer"&gt;Elixir&lt;/a&gt; and runs on the&lt;a href="https://www.erlang.org/blog/a-brief-beam-primer/" rel="noopener noreferrer"&gt;BEAM&lt;/a&gt;, the virtual machine of&lt;a href="https://www.erlang.org/" rel="noopener noreferrer"&gt;Erlang/OTP&lt;/a&gt;, and it is an independent implementation inspired by the public design of&lt;a href="https://en.wikipedia.org/wiki/LinkedIn" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;'s &lt;a href="https://www.linkedin.com/blog/engineering/infrastructure/introducing-northguard-and-xinfra" rel="noopener noreferrer"&gt;NorthGuard&lt;/a&gt;log storage. It is not affiliated with or endorsed by LinkedIn. This post introduces Malachi as it is in v0.28.4.&lt;/p&gt;

&lt;h2&gt;
  
  
  A log that can change shape
&lt;/h2&gt;

&lt;p&gt;In most log brokers a &lt;a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern" rel="noopener noreferrer"&gt;topic&lt;/a&gt; is cut into a fixed number of&lt;a href="https://kafka.apache.org/documentation/#intro_concepts_and_terms" rel="noopener noreferrer"&gt;partitions&lt;/a&gt;, and that number decides where every &lt;a href="https://en.wikipedia.org/wiki/Partition_(database)" rel="noopener noreferrer"&gt;key&lt;/a&gt; lands. Growing a topic means moving keys, and the&lt;a href="https://en.wikipedia.org/wiki/Client_(computing)" rel="noopener noreferrer"&gt;clients&lt;/a&gt; notice.&lt;/p&gt;

&lt;p&gt;A Malachi client deals in three things: a topic, a key and a &lt;a href="https://malachi-hq.github.io/malachi/log-model.html" rel="noopener noreferrer"&gt;position&lt;/a&gt;. Under the hood a topic is a set of&lt;a href="https://malachi-hq.github.io/malachi/log-model.html" rel="noopener noreferrer"&gt;ranges&lt;/a&gt;, slices of its &lt;a href="https://en.wikipedia.org/wiki/Shard_(database_architecture)" rel="noopener noreferrer"&gt;keyspace&lt;/a&gt;, and an operator&lt;a href="https://malachi-hq.github.io/malachi/clustering-and-resharding.html" rel="noopener noreferrer"&gt;splits and merges them&lt;/a&gt; while &lt;a href="https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem" rel="noopener noreferrer"&gt;producers&lt;/a&gt; keep writing. A&lt;a href="https://kafka.apache.org/documentation/#intro_concepts_and_terms" rel="noopener noreferrer"&gt;consumer&lt;/a&gt;'s position is an &lt;a href="https://malachi-hq.github.io/malachi/produce-and-consume.html" rel="noopener noreferrer"&gt;opaque token&lt;/a&gt;, 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, &lt;a href="https://kafka.apache.org/documentation/#semantics" rel="noopener noreferrer"&gt;at least once&lt;/a&gt;, and it never loses one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6cxwpxix81j6f8n53ucr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6cxwpxix81j6f8n53ucr.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" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What an acknowledgement means
&lt;/h2&gt;

&lt;p&gt;Each range is a series of &lt;a href="https://malachi-hq.github.io/malachi/log-model.html" rel="noopener noreferrer"&gt;segments&lt;/a&gt;, and each segment is&lt;a href="https://en.wikipedia.org/wiki/Replication_(computing)" rel="noopener noreferrer"&gt;replicated&lt;/a&gt; across nodes. A write is acknowledged once a&lt;a href="https://en.wikipedia.org/wiki/Quorum_(distributed_computing)" rel="noopener noreferrer"&gt;majority&lt;/a&gt; of its segment's replicas has written it to disk with &lt;a href="https://man7.org/linux/man-pages/man2/fsync.2.html" rel="noopener noreferrer"&gt;fsync&lt;/a&gt;. The &lt;a href="https://en.wikipedia.org/wiki/Metadata" rel="noopener noreferrer"&gt;metadata&lt;/a&gt;, which topics and ranges exist and where their segments live, is replicated by &lt;a href="https://raft.github.io/" rel="noopener noreferrer"&gt;Raft&lt;/a&gt;. Membership uses &lt;a href="https://www.cs.cornell.edu/projects/Quicksilver/public_pdfs/SWIM.pdf" rel="noopener noreferrer"&gt;SWIM&lt;/a&gt;, placement is rack-aware, and the cluster repairs the replicas it finds missing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjbt82179oaczh6curjzv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjbt82179oaczh6curjzv.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" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Security is on by default: &lt;a href="https://en.wikipedia.org/wiki/Transport_Layer_Security" rel="noopener noreferrer"&gt;TLS&lt;/a&gt;, with &lt;a href="https://malachi-hq.github.io/malachi/authentication.html" rel="noopener noreferrer"&gt;mTLS for clients&lt;/a&gt;,&lt;a href="https://openid.net/developers/how-connect-works/" rel="noopener noreferrer"&gt;OIDC&lt;/a&gt; sign-in and&lt;a href="https://malachi-hq.github.io/malachi/per-topic-acls.html" rel="noopener noreferrer"&gt;access control per topic&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evidence with every release
&lt;/h2&gt;

&lt;p&gt;A claim about &lt;a href="https://en.wikipedia.org/wiki/Durability_(database_systems)" rel="noopener noreferrer"&gt;durability&lt;/a&gt; is worth the test behind it. Every release of Malachi ships with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://malachi-hq.github.io/malachi/running-chaos-drills.html" rel="noopener noreferrer"&gt;chaos drills&lt;/a&gt; that kill nodes, break storage and roll out bad configurations, then check that every acknowledged write is still there;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Load_testing" rel="noopener noreferrer"&gt;load tests&lt;/a&gt; run on the release's exact code, published with the hardware they ran on and the noise between runs;&lt;/li&gt;
&lt;li&gt;a &lt;a href="https://github.com/malachi-hq/malachi/blob/main/CHANGELOG.md" rel="noopener noreferrer"&gt;changelog&lt;/a&gt; and upgrade notes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsjysoi60o35ksg0hi3kg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsjysoi60o35ksg0hi3kg.png" alt="Each release feeds chaos drills, load tests and its changelog, and their results are published with it" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The results of every run are published beside the code, in the&lt;a href="https://github.com/malachi-hq/malachi/blob/main/benchmark/README.md" rel="noopener noreferrer"&gt;benchmark results&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;p&gt;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&lt;a href="https://github.com/orgs/malachi-hq/projects/1" rel="noopener noreferrer"&gt;project board&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;One node on your machine, with &lt;a href="https://www.docker.com/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run --name malachi \
  -p 127.0.0.1:4040:4040 -p 127.0.0.1:4041:4041 \
  -e &lt;span class="nv"&gt;MALACHI_ADMIN_PASS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_secure_password \
  -e &lt;span class="nv"&gt;MALACHI_REQUIRE_TLS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt; \
  -e &lt;span class="nv"&gt;MALACHI_ADVERTISED_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;127.0.0.1 \
  hectorcardoso/malachi:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It serves &lt;a href="https://en.wikipedia.org/wiki/Plaintext" rel="noopener noreferrer"&gt;plaintext&lt;/a&gt; on &lt;a href="https://en.wikipedia.org/wiki/Localhost" rel="noopener noreferrer"&gt;localhost&lt;/a&gt; only, which is why TLS is turned off there. The&lt;a href="https://malachi-hq.github.io/malachi/introduction.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; covers &lt;a href="https://en.wikipedia.org/wiki/Computer_cluster" rel="noopener noreferrer"&gt;clusters&lt;/a&gt;, TLS and the client protocol, and the code is on&lt;a href="https://github.com/malachi-hq/malachi" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, &lt;a href="https://github.com/malachi-hq/malachi/blob/main/LICENSE" rel="noopener noreferrer"&gt;MIT licensed&lt;/a&gt;. Issues labelled&lt;a href="https://github.com/malachi-hq/malachi/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22" rel="noopener noreferrer"&gt;good first issue&lt;/a&gt;are a place to start contributing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow along
&lt;/h2&gt;

&lt;p&gt;New posts arrive with each release: subscribe to the newsletter below, follow the&lt;a href="https://malachi-hq.github.io/malachi/blog/feed.xml" rel="noopener noreferrer"&gt;Atom feed&lt;/a&gt; or the &lt;a href="https://www.linkedin.com/company/malachi-hq" rel="noopener noreferrer"&gt;Malachi page on LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in v0.28.4
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;batch the sealed copy integrity probe (#372)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>elixir</category>
      <category>opensource</category>
      <category>distributedsystems</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
