<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aman mandloi on Medium]]></title>
        <description><![CDATA[Stories by Aman mandloi on Medium]]></description>
        <link>https://medium.com/@amankumarmandloi?source=rss-23171b7d1371------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jYv5vVfzAAbwiIH0AocygQ.jpeg</url>
            <title>Stories by Aman mandloi on Medium</title>
            <link>https://medium.com/@amankumarmandloi?source=rss-23171b7d1371------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 17:00:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amankumarmandloi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Event Bus to ETL Backbone: How We Use Kafka at Zoop]]></title>
            <link>https://zoopone.tech/from-event-bus-to-etl-backbone-how-we-use-kafka-at-zoop-83cd44a41cb8?source=rss-23171b7d1371------2</link>
            <guid isPermaLink="false">https://medium.com/p/83cd44a41cb8</guid>
            <category><![CDATA[kafka-connect]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[etl-pipeline]]></category>
            <category><![CDATA[debezium]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Aman mandloi]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 06:59:07 GMT</pubDate>
            <atom:updated>2026-11-24T06:59:07.291Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1 of our Connect Service series: how a quiet event bus became the backbone of our own ETL platform.</h4><p><em>Written by </em><a href="https://medium.com/@amankumarmandloi"><em>@amankumarmandloi</em></a><em> and </em><a href="https://medium.com/@debrajrout28"><em>@debrajrout28</em></a></p><p>A year ago, our Kafka cluster was bored. It moved 200 to 700 messages per second between a handful of microservices, and on a busy day it touched 1,000.</p><p>Today the same self-hosted Kafka still sits at a few hundred messages per second on a normal day, but it bursts to <strong>14,000 to 17,000 per second</strong> at peak. Our peaks are now 14 to 17 times our old worst spike.</p><p>Nothing about Kafka changed. What changed is how we used it. We stopped treating it as a simple message pipe and made it the backbone of our own ETL platform, which we call <strong>Connect Service</strong>.</p><p>This post covers the Kafka side of that story: why we self-host, why Kafka sits in the middle of everything, and how we run it. The cost story gets its own post next.</p><h3>Why we self-host</h3><p>We’re a startup, so we look hard at every managed service on the bill. Our default is to run tools on our own infrastructure on GCP.</p><p>Cost is the obvious reason, but not the only one. When we own a tool, we can tune every setting, read every log, and build new things around it. A managed service gives you its features. A self-hosted one gives you the whole engine.</p><p>Kafka is the clearest example. We started on <strong>managed Kafka</strong> in all three environments: Dev, UAT and Prod. It worked, but it cost a lot for the traffic we had.</p><p>So last year we self-hosted Kafka on <strong>dev and UAT first</strong> and ran it there for about six months. Once we trusted our setup, we moved prod too. Since then, our self-hosted Kafka has run at <strong>100% SLA</strong>.</p><blockquote><strong><em>The lesson:</em></strong><em> the tools you already run can usually do far more than you use them for. Self-hosting is how we found that out.</em></blockquote><h3>Where we started: Kafka as a quiet event bus</h3><p>In the beginning, Kafka was a bus between our microservices. It carried transactional data such as user events and transaction events.</p><p>The pattern was simple:</p><ul><li><strong>Service 1</strong> publishes an event to a topic.</li><li><strong>Service 2</strong> consumes it and stores it in a database for analytics and billing.</li><li><strong>Service 3</strong> consumes the same event for its own processing.</li><li><strong>Other services</strong> don’t subscribe to that topic, so they never see it.</li></ul><p>This is the classic publish/subscribe setup. The producer doesn’t know or care who’s listening. You can add a new consumer tomorrow without touching Service 1.</p><p>At <strong>200 to 700 messages per second</strong>, with spikes near 1,000, this was a very light load for Kafka. It worked fine, but we were using a fraction of what Kafka can do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sxjP-t1ljge0-MQ6-1X-VQ.png" /></figure><p><em>Read more:</em> <a href="https://kafka.apache.org/documentation/#introduction">Kafka introduction</a> · <a href="https://docs.confluent.io/kafka/design/consumer-design.html">Consumers and consumer groups</a></p><h3>The ETL problem</h3><p>This year, our ETL pipelines on a third-party ETL tool grew from <strong>2 to 12 in a single month</strong>. They pulled data from PostgreSQL databases (via CDC), Google Ads, and files in Google Cloud Storage.</p><p>The volume grew with them. In August the tool processed 6,994 GB, in September 5,957 GB, and in October 13,662 GB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mdW_F6sDqmdxiEpzPL1Cw.png" /></figure><p>That’s about <strong>26.6 TB in three months</strong>. October stands out: a CDC surge on a single table produced <strong>11,389 GB in 15 days</strong>. One busy table moved more data in two weeks than all our other pipelines did in a normal month.</p><p>The worst part was that many pipelines were processing data nobody used. We were paying, in money and in compute, to move bytes into a warehouse where they sat untouched.</p><p>That pushed us to ask a bigger question: what would it take to build this ourselves?</p><h3>Why Kafka sits in the middle</h3><p>Building our own ETL meant learning how ETL tools really work. We studied CDC events, file extractors, and how each kind of source hands over its data.</p><p>One need came up again and again. Sources and destinations never run at the same speed. A database can burst millions of changes in minutes, while a warehouse might be slow, or down for maintenance. We needed something in between: a <strong>durable log journal</strong> that soaks up bursts and lets the slow side catch up.</p><p>We already had that tool running. Kafka is, at its heart, exactly this:</p><ul><li><strong>An append-only log on disk.</strong> Every message is written to the end of a file and given a number, its <em>offset</em>. Reading a message doesn’t delete it.</li><li><strong>Consumers pull at their own pace.</strong> If the warehouse slows down, it simply falls behind and catches up later. Kafka calls this <em>consumer lag</em>. Nothing is lost while it happens.</li><li><strong>Replay is built in.</strong> Consumers commit the offset they’ve reached. If a bug corrupts warehouse data, we rewind the offset and process the messages again.</li></ul><p>In short, Kafka turns “the warehouse is down” from an incident into a delay.</p><p><em>Read more:</em> <a href="https://kafka.apache.org/documentation/#design">Kafka design: persistence and the log</a> · <a href="https://kafka.apache.org/documentation/#design_pull">Why Kafka consumers pull</a></p><h3>The proof of concept: Debezium on a small box</h3><p>We started with PostgreSQL, our biggest source. The standard open-source way to stream changes out of Postgres is <strong>Debezium</strong>, which runs inside <strong>Kafka Connect</strong>.</p><p>Here’s how it works, in plain terms:</p><ol><li>Postgres writes every committed change to its <strong>write-ahead log (WAL)</strong>.</li><li>With logical replication turned on, Debezium reads those changes through a <strong>replication slot</strong>, which remembers how far it has read.</li><li>On first start, Debezium takes a <strong>snapshot</strong> of each table, then switches to streaming live changes.</li><li>Each insert, update and delete becomes one event in Kafka, on a topic for that table.</li></ol><p>For the POC, we ran <strong>Debezium on Kafka Connect on one GCP instance with 2 vCPUs and 4 GB of RAM</strong>. Kafka itself was not on that box: it stayed on our existing self-hosted cluster, on separate nodes we’d been running since last year. At low volume it ran smoothly. As we pushed more data through, CPU on that instance climbed to around <strong>70%</strong>.</p><p>That was the signal we wanted. The design worked, and we now knew where it would need room to grow: Debezium, Kafka Connect, serialization and compression were all competing for the same two cores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Imox5R5n3BF2e9e2SDK7MQ.png" /></figure><p><em>Read more:</em> <a href="https://debezium.io/documentation/reference/stable/connectors/postgresql.html">Debezium PostgreSQL connector</a> · <a href="https://www.postgresql.org/docs/current/logicaldecoding-explanation.html">Postgres logical decoding</a></p><h3>Our architecture today</h3><p>The same Kafka cluster now does two jobs at once.</p><p><strong>The event bus</strong> still carries events between microservices, exactly as before.</p><p><strong>The ETL backbone</strong> carries change data from our sources to our warehouses:</p><blockquote><em>Sources (PostgreSQL) → CDC events → Debezium (Kafka Connect) → Kafka → Warehouse</em></blockquote><p>File and API sources, such as Google Cloud Storage buckets and Google Ads, enter the same way through extractors in Connect Service. Everything lands in Kafka first, and sinks read from Kafka at their own pace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRG3ffz2Bd4Mhhp-XWskjg.png" /></figure><p>That’s the key design choice: <strong>Kafka is the only thing every part of the system talks to.</strong> Sources never wait on destinations, and adding a new destination means adding a new consumer, not a new pipeline.</p><h3>How we run Kafka</h3><p>These are the design choices that let a small, self-hosted cluster carry all of this.</p><h4>Two topics for every table: main and DLQ</h4><p>Every table we sync gets <strong>its own main topic and its own dead letter queue (DLQ) topic</strong>. A pipeline with 10 tables has 20 topics.</p><p>The main topic carries the table’s change events. If a record can’t be written to the destination (bad data, a schema mismatch), it goes to that table’s DLQ instead of blocking everything behind it. One broken row in one table never stops the other nine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dD7n0yGuJadqyFT0mMV6nw.png" /></figure><h4>Every topic can have its own settings</h4><p>Because each table has its own topic, we can tune each one separately:</p><ul><li><strong>Retention</strong> (retention.ms): how long Kafka keeps messages. Busy tables keep less; critical ones keep more so we can replay further back.</li><li><strong>Message size</strong> (max.message.bytes): Kafka&#39;s default limit is about 1 MB per batch. Tables with large rows get a higher limit on their topic only.</li><li><strong>Cleanup policy</strong> (cleanup.policy): delete drops old messages after retention; compact keeps the latest version of each key.</li></ul><p>Changing a topic setting is one command:</p><pre>kafka-configs.sh --bootstrap-server &lt;broker&gt;:9092 \<br>  --entity-type topics --entity-name &lt;table-topic&gt; \<br>  --alter --add-config max.message.bytes=5242880,retention.ms=259200000</pre><h4>Messages wait on disk, so we can replay</h4><p>Kafka stores every message on disk until retention expires, and each consumer commits the offset it has processed. If a warehouse goes down, messages pile up safely and the sink picks up where it stopped. If we find a bug in a transform, we reset the offset and process the data again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgz0D8R36y-ZvPIg5kU5Hg.png" /></figure><h4>Three brokers across three zones</h4><p>We run <strong>three brokers in one GCP region, spread across zones a, b and c</strong>. Each broker is told which zone it lives in (broker.rack), so Kafka places copies of each partition in different zones. If one zone has a bad day, the other two keep serving.</p><h4>Avro and compression keep messages small</h4><p>These are two separate layers, and people often mix them up:</p><ol><li><strong>Serialization (Avro).</strong> JSON repeats every field name in every message. Avro sends only the values in a compact binary format, while the schema is stored once in a schema registry. Messages carry a small schema ID instead of the full schema.</li><li><strong>Compression (codecs).</strong> Kafka then compresses whole batches of messages. The options are <strong>gzip</strong> (smallest output, most CPU), <strong>snappy</strong> and <strong>lz4</strong> (very fast, lighter compression), and <strong>zstd</strong> (close to gzip’s size at close to lz4’s speed). On our brokers, we use <strong>zstd</strong>.</li></ol><p>Together, they shrink what goes over the network and onto disk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTR6tEjVHSNUXOWHSgYIcQ.png" /></figure><p><em>Read more:</em> <a href="https://kafka.apache.org/documentation/#topicconfigs">Topic configs</a> · <a href="https://kafka.apache.org/documentation/#basic_ops_racks">Rack awareness</a> · <a href="https://www.confluent.io/blog/kafka-connect-deep-dive-error-handling-dead-letter-queues/">Kafka Connect error handling and DLQs</a> · <a href="https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/serdes-avro.html">Avro with Schema Registry</a> · <a href="https://www.confluent.io/blog/apache-kafka-message-compression/">Kafka message compression</a></p><h3>The numbers</h3><h4>Throughput: from hundreds to thousands per second</h4><p>Before the ETL pipelines, Kafka handled <strong>200 to 700 messages per second</strong>, with spikes near 1,000. Now the answer depends on when you look:</p><ul><li><strong>Day to day</strong>, the 6-hour average over the last month had a median of about <strong>560 messages per second</strong>. Half of all readings fell between roughly 320 and 810.</li><li><strong>Busy windows</strong> push the 6-hour average into the thousands: about <strong>6,700 per second</strong> on October 27 and 4,200 on November 16.</li><li><strong>Short peaks</strong> reach <strong>14,000 to 17,000 messages per second</strong>. There’s no fixed number; it depends on traffic. That’s 14 to 17 times our old ~1,000 spike.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cG59hDCNlIEch5S4BnBNjQ.png" /></figure><p>This is exactly the shape Kafka is built for. Most of the time it’s quiet, then a backfill or a busy table sends a burst. Kafka writes the burst to disk, and consumers work through it at their own pace.</p><p>Same cluster design, same three brokers, no drama.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcovznPv6mCrrEiIeO3G_Q.png" /></figure><h4>What Connect Service processes now</h4><p>Connect Service went live in September 2026. It read 128 GB (203 million rows) from our sources in September, 2.17 TB (1.38 billion rows) in October, and 852 GB (669 million rows) in the first 23 days of November.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1jHR5du20vryZEzVef7hA.png" /></figure><p>October is high because it included large historical backfills, such as 1.6 TB from one event bucket. November is the steadier picture: about <strong>29 million rows and 37 GB a day</strong>, with more syncs running than ever.</p><p>We now run <strong>16 syncs</strong> on Connect Service, against the 12 pipelines we had on the third-party tool. They cover 8 service databases, event and profile buckets in Cloud Storage, and Google Ads, feeding two warehouses.</p><h3>Lessons learned</h3><p><strong>1. Watch your replication slots, not just Kafka.</strong> A Postgres replication slot keeps WAL on disk until Debezium confirms it has read it. If a connector stops, or is deleted without dropping its slot, WAL piles up until the database disk fills. Set max_slot_wal_keep_size, alert on slot lag, and drop slots you no longer use.</p><p><strong>2. Quiet tables need a heartbeat.</strong> If the tables you capture rarely change but the database is busy, the slot’s position stops moving while WAL grows. Debezium’s heartbeat.interval.ms keeps it moving.</p><p><strong>3. One hot table can dominate.</strong> Our October surge showed how much a single table can produce. Giving each table its own topic, settings and DLQ keeps a hot table from hurting the quiet ones.</p><p><strong>4. Give Kafka Connect room to grow.</strong> Our 2 vCPU POC proved the idea, but Debezium, serialization and compression all want CPU. Size the Connect workers for real volume before production.</p><p><strong>5. Only move data someone uses.</strong> The cheapest pipeline is the one you don’t run. Owning the platform made it easy to see which syncs were actually needed.</p><p><em>Read more:</em> <a href="https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-wal-disk-space">WAL disk space with Debezium</a> · <a href="https://shopify.engineering/capturing-every-change-shopify-sharded-monolith">Shopify on capturing every change with Debezium</a></p><h3>What’s next</h3><p>Kafka went from a quiet event bus to the backbone of our data platform, and it barely noticed. The bigger lesson for us: before you buy a new tool, look at what the tools you already run can do.</p><p>In <strong>Part 2</strong>, we’ll open the books: how moving from a third-party ETL tool to Connect Service cut our pipeline costs by 70 to 90%, while running more pipelines than before.</p><p>If you’re running Debezium and Kafka yourself, or thinking about it, we’d love to hear how it’s going. Leave a comment.</p><h3>Further reading</h3><ul><li><a href="https://kafka.apache.org/documentation/">Apache Kafka documentation</a></li><li><a href="https://kafka.apache.org/40/getting-started/upgrade/">Kafka 4.0 upgrade notes: KRaft only, no ZooKeeper</a></li><li><a href="https://debezium.io/documentation/reference/stable/connectors/postgresql.html">Debezium PostgreSQL connector</a></li><li><a href="https://www.confluent.io/blog/kafka-connect-deep-dive-error-handling-dead-letter-queues/">Kafka Connect: error handling and dead letter queues</a></li><li><a href="https://www.confluent.io/blog/apache-kafka-message-compression/">Apache Kafka message compression</a></li><li><a href="https://www.linkedin.com/blog/engineering/open-source/apache-kafka-trillion-messages">How LinkedIn customizes Kafka for 7 trillion messages a day</a></li><li><a href="https://www.notion.com/blog/building-and-scaling-notions-data-lake">How Notion built its data lake with Debezium and Kafka</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83cd44a41cb8" width="1" height="1" alt=""><hr><p><a href="https://zoopone.tech/from-event-bus-to-etl-backbone-how-we-use-kafka-at-zoop-83cd44a41cb8">From Event Bus to ETL Backbone: How We Use Kafka at Zoop</a> was originally published in <a href="https://zoopone.tech/">Zoop Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>