<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>etcd Internals on Random Tech Excursions</title><link>https://ssushant.me/etcd/</link><description>Recent content in etcd Internals on Random Tech Excursions</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate><atom:link href="https://ssushant.me/etcd/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://ssushant.me/etcd/chapter-1/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-1/</guid><description>&lt;h1 id="chapter-1-grpc-key-value-api-and-clientv3" class="relative group"&gt;Chapter 1: gRPC Key-Value API and clientv3 &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-1-grpc-key-value-api-and-clientv3" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Welcome! If you are new to etcd, you are in the right place. etcd is a distributed, reliable key-value store. That means it stores simple &lt;code&gt;key -&amp;gt; value&lt;/code&gt; pairs and makes them available to many machines.&lt;/p&gt;&#10;&lt;p&gt;Imagine you are building a small web app. You want all of your servers to display the same dashboard background color. You could edit a config file on every server, but that gets messy. Instead, you store one key called &lt;code&gt;dashboard/color&lt;/code&gt; in etcd. Your Go application uses the official Go client, &lt;code&gt;clientv3&lt;/code&gt;, to save and read that value.&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-10/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-10/</guid><description>&lt;h1 id="chapter-10-robustness-testing-framework" class="relative group"&gt;Chapter 10: Robustness Testing Framework &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-10-robustness-testing-framework" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Welcome back! In the previous chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-9/"&gt;Multi-Module Go Repository&lt;/a&gt;, you learned how etcd organizes its code into separate Go modules. That keeps dependencies clean and makes the project easier to maintain.&lt;/p&gt;&#10;&lt;p&gt;But a clean codebase is not enough. How do we know etcd’s distributed promises really hold? How do we prove that a successful write is still there after a crash, or that watches never travel back in time? That is exactly what the &lt;strong&gt;Robustness Testing Framework&lt;/strong&gt; is for.&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-2/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-2/</guid><description>&lt;h1 id="chapter-2-etcdctl--etcdutl-command-line-tools" class="relative group"&gt;Chapter 2: etcdctl / etcdutl Command-Line Tools &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-2-etcdctl--etcdutl-command-line-tools" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Welcome back! In the previous chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-1/"&gt;gRPC Key-Value API and clientv3&lt;/a&gt;, we wrote a small Go program to save and read a key. That is a great way to understand how applications talk to etcd. But sometimes you just want to type one command and see what is stored in the cluster. You do not want to write a Go program every time.&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-3/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-3/</guid><description>&lt;h1 id="chapter-3-raft-consensus-engine" class="relative group"&gt;Chapter 3: Raft Consensus Engine &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-3-raft-consensus-engine" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Welcome back! In the previous chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-2/"&gt;etcdctl / etcdutl Command-Line Tools&lt;/a&gt;, you learned how to talk to a running etcd cluster using command-line tools. You ran &lt;code&gt;etcdctl put&lt;/code&gt;, saw &lt;code&gt;OK&lt;/code&gt;, and read the value back.&lt;/p&gt;&#10;&lt;p&gt;But have you ever wondered: &lt;strong&gt;how do multiple etcd servers agree on that value?&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;If you have only one etcd server, it can just write the value to disk. But etcd is built to run as a cluster of multiple servers. If those servers all wrote independently, they would quickly disagree. One server might have &lt;code&gt;&amp;quot;blue&amp;quot;&lt;/code&gt;, another might have &lt;code&gt;&amp;quot;green&amp;quot;&lt;/code&gt;, and a third might not have the key at all.&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-4/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-4/</guid><description>&lt;h1 id="chapter-4-cluster-membership-and-peer-communication" class="relative group"&gt;Chapter 4: Cluster Membership and Peer Communication &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-4-cluster-membership-and-peer-communication" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;In the last chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-3/"&gt;Raft Consensus Engine&lt;/a&gt;, you learned how etcd members use Raft to agree on a shared log of decisions. But what exactly is an “etcd member”? How do members join, leave, and talk to each other? That is what this chapter is about.&lt;/p&gt;&#10;&lt;p&gt;Think of an etcd cluster as a &lt;strong&gt;partner board&lt;/strong&gt;. Each member is a partner with a name and a vote. The board makes decisions by voting. New partners can join, old partners can leave, and each partner has a phone number so they can be reached. The phone number is called a &lt;strong&gt;peer URL&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-5/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-5/</guid><description>&lt;h1 id="chapter-5-wal-and-backend-snapshot-storage" class="relative group"&gt;Chapter 5: WAL and Backend Snapshot Storage &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-5-wal-and-backend-snapshot-storage" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;In the previous chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-4/"&gt;Cluster Membership and Peer Communication&lt;/a&gt;, you learned how etcd members join a cluster and talk to each other on port &lt;code&gt;2380&lt;/code&gt;. But what happens when an etcd member crashes and restarts? How does it remember all of the keys and values you wrote?&lt;/p&gt;&#10;&lt;p&gt;The answer is etcd’s storage layer. It is made of two important pieces that work together:&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-6/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-6/</guid><description>&lt;h1 id="chapter-6-data-integrity-and-corruption-detection" class="relative group"&gt;Chapter 6: Data Integrity and Corruption Detection &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-6-data-integrity-and-corruption-detection" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;In the last chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-5/"&gt;WAL and Backend Snapshot Storage&lt;/a&gt;, you saw how etcd stores every Raft entry in a Write-Ahead Log (WAL) and how it applies those entries to a backend database. But how does etcd know that the backend database has not been corrupted? How can you prove that a snapshot backup is valid? What happens when one etcd member secretly has different data than the others?&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-7/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-7/</guid><description>&lt;h1 id="chapter-7-security-and-trust-boundaries" class="relative group"&gt;Chapter 7: Security and Trust Boundaries &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-7-security-and-trust-boundaries" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Welcome back! In the previous chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-6/"&gt;Data Integrity and Corruption Detection&lt;/a&gt;, we saw how etcd uses hashes and consistent indexes to detect when data on disk is corrupted. Now we ask an even earlier question: &lt;strong&gt;should that data have been allowed to reach etcd in the first place?&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;That is the job of &lt;strong&gt;Security and Trust Boundaries&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-8/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-8/</guid><description>&lt;h1 id="chapter-8-feature-gates-and-release-stages" class="relative group"&gt;Chapter 8: Feature Gates and Release Stages &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-8-feature-gates-and-release-stages" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Welcome back! In the previous chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-7/"&gt;Security and Trust Boundaries&lt;/a&gt;, we learned how etcd protects the two main “gates” into a cluster: port &lt;code&gt;2379&lt;/code&gt; for clients and port &lt;code&gt;2380&lt;/code&gt; for peers. mTLS makes sure only trusted actors can get inside.&lt;/p&gt;&#10;&lt;p&gt;But there is another kind of gate inside etcd itself: a &lt;strong&gt;feature gate&lt;/strong&gt;. It controls which new features are visible, active, and trustworthy. Feature gates are how etcd manages code that is still experimental while keeping stable users safe.&lt;/p&gt;</description></item><item><title/><link>https://ssushant.me/etcd/chapter-9/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ssushant.me/etcd/chapter-9/</guid><description>&lt;h1 id="chapter-9-multi-module-go-repository" class="relative group"&gt;Chapter 9: Multi-Module Go Repository &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#chapter-9-multi-module-go-repository" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Welcome back! In the previous chapter, &#10; &#10; &lt;a href="https://ssushant.me/etcd/chapter-8/"&gt;Feature Gates and Release Stages&lt;/a&gt;, we saw how etcd introduces new features carefully, hiding them behind gates until they are ready. But where does the code for those features actually live? If you open the etcd repository, you won’t find one giant Go module. Instead, you’ll find a &lt;strong&gt;monorepo with several Go modules&lt;/strong&gt; — and each one has a special job.&lt;/p&gt;</description></item></channel></rss>