
How Zomato Handles 50 TB of Logs a Day with Kafka
#kafka #distributedsystems #backend #systemdesign
Satyam Singh
How Zomato Handles 50 TB of Logs a Day with Kafka (and What You Can Steal for Your Own Backend)
A practical look at Kafka, ClickHouse and Go workers in a real production system
By Satym
Introduction
Picture a Friday night, 9 PM. Thousands of people open Zomato at the same moment, and every tap sets off a chain of services: search, cart, payments, the restaurant, the delivery partner. Each of those services writes logs. Millions of lines a minute.
Those logs are the first thing an engineer opens when an order fails. So where do they all go? I dug through Zomato's engineering blogs, talks and a few third-party write-ups to find out. Here is what they have shared, what I found interesting, and what you can borrow for your own systems.
How big are Zomato's logs, really?
Big. In 2023, Zomato's Data Platform team said their services produced more than 50 TB of uncompressed logs every day, peaking at 150 million log events per minute. They were running Elasticsearch, and it was hurting. The clusters got harder to manage as volume grew, and because traffic is so spiky, they had to over-provision just to survive the peaks. That means paying for idle servers most of the day.
So they moved log storage to ClickHouse, a column-oriented database that is very good at fast writes and fast analytical reads. But the interesting part, for this post, is what sits in front of it: Kafka.
How the logging pipeline works
Zomato's blog, and a Quastor summary of it, describe the flow roughly like this:
Collect. Filebeat picks up logs from Docker containers and EC2 instances.
Buffer. Filebeat pushes them into Kafka.
Ingest. Custom Go workers read from Kafka, group records into batches and insert them into ClickHouse.
Store. ClickHouse holds the logs. In 2023 that was 10
m6g.16xlargeEC2 nodes, though that number has probably changed.Search. A custom in-house UI lets developers filter and read logs.
Apps / containers -> Filebeat -> Kafka -> Go workers (batching) -> ClickHouse -> Log UIWhy Kafka sits in the middle
Zomato's posts call Kafka the buffer. The reasons below are my own reading of why that design works, not claims Zomato makes.
It soaks up spikes. Dinner rush, a cricket final, New Year's Eve. Producers write as fast as they need to, and consumers drain at a pace the database can handle.
It decouples teams. Apps only need to know how to write to a topic. If the database is slow or being upgraded, nobody upstream notices.
Nothing gets lost. If the store has a rough hour, logs wait in Kafka and consumers pick up where they left off.
Each side scales on its own. Need more ingestion? Add workers. The producers don't change.
Why not just use ClickHouse's Kafka connector?
ClickHouse can read from Kafka by itself, yet Zomato's team chose to write their own Go workers. The goal was batching. According to Quastor's summary, each batch held up to 20,000 log entries, which kept the delay between a log being written and showing up in ClickHouse to roughly five seconds.
The logic is old but solid. For analytical databases, lots of tiny inserts hurt and a few big ones are cheap. Moving the batching into stateless workers takes that pressure off the database. A few more details from Zomato's blog:
Workers ran on spot instances to save money. That is only safe because they are stateless, and Kafka keeps the data if a worker vanishes.
Batches went round-robin to whichever ClickHouse node was available, which spreads the load.
If a node goes down, inserts simply move to a healthy one.
Here is the core loop as I would sketch it. It is illustrative pseudo-code, not Zomato's actual code:
loop:
msg = kafka.read()
buffer.add(transform(msg))
if buffer.size >= MAX_BATCH or buffer.age >= MAX_WAIT:
clickhouse.insert(buffer) # pick any healthy node
kafka.commit(offsets) # commit only after a successful insert
buffer.clear()Notice that the offset commit comes after the insert succeeds. That gives you at-least-once delivery: after a crash you may see duplicates, but you won't lose logs. For logs, that is usually a fair trade.
If you would rather read real code, a Hashnode post walks through a similar Go pipeline with parallel Kafka readers, a buffer stage and a ClickHouse output stage.
Keeping search fast (and the cluster alive)
Getting logs in is only half the job. Zomato's team also shared how they keep reads fast:
Flexible schema. Log formats change constantly, so the schema is semi-structured and can evolve without painful migrations.
Skip indexes. To avoid scanning giant tables, they used ClickHouse skip indexes, including Bloom filters. Their example: blocks of 8,000 records at about 50 words each, a filter sized for roughly 400K elements, a 0.1 false-positive rate and 3 hash functions.
Load shedding. When the cluster is stressed, expensive queries get killed so lightweight ones keep working.
Monitoring. Metrics flow through Prometheus into Grafana: CPU, memory, network, insert and query times, and rejected inserts.
The reported payoff: 99% of queries finish within 10 seconds, ingestion lag stays under 5 seconds, and they save over a million dollars a year compared with Elasticsearch.
What happens on New Year's Eve
New Year's Eve is Zomato's biggest stress test, and their 2023 engineering post shares some of the numbers:
Their in-house logging platform, LogStore, handled about 60 TB of logs that day, peaking at 80 million records a minute.
Kafka, which they call the backbone of their event-driven architecture, processed 450+ million messages a minute, with clusters hitting 5.6 GBps combined at peak.
Beforehand, the team ran 14,000 minutes of benchmarking across 100+ services, peaking at 50 million requests per minute, with about 400 TB of recorded requests stored.
That last bullet is easy to miss: Kafka isn't just for logs here. It also holds recorded live traffic that gets replayed later for load testing.
The newer chapter: making Kafka cheaper
In 2026, WarpStream published a case study on Eternal, the company behind Zomato and Blinkit. Keep in mind it was written by a vendor. Still, the numbers are worth a look:
Logging ran on self-hosted Apache Kafka, kept in one availability zone with a single level of replication to dodge cross-zone network fees.
Since logs aren't latency sensitive, they tried WarpStream, a Kafka-compatible system built on object storage, by writing production traffic to both systems at once. The proof of concept took two weeks, then another two to go live.
They report about 60% lower cost than the single-AZ Kafka setup.
Load swings from roughly 2.3 GiB/s in the quiet hours to about 25 GiB/s at peak across clusters, so autoscaling matters.
For benchmarking, they swapped out managed Kafka, where a new cluster took 20 to 30 minutes, and reported about 80% savings and clusters that start in seconds. Backfills averaged 52 million messages a minute.
Latency-sensitive workloads stay on Confluent Cloud, so topics are treated like a service, routed by cost and latency needs.
My takeaway: there is no single winner. The right Kafka setup depends on how much delay your workload can tolerate and how spiky your traffic is.
Kafka beyond logs
Logs aren't the only place Kafka shows up. An AWS open source blog describes Flink jobs that write ORC files to S3 and also publish enriched data to another Kafka topic feeding an Apache Druid cluster. And a talk on Zomato's real-time ML platform describes backend events flowing through Kafka into Flink for real-time features, which then land in a feature store.
What I'd take away
Put a buffer between producers and storage. Spikes become a smoothing problem instead of an outage.
Batch your writes to analytical databases. Owning the batching gives you control over latency and load.
Keep workers stateless. That is what lets you run them on cheap spot instances.
Commit offsets after the write succeeds. Decide on your delivery guarantees up front and design for duplicates.
Plan to shed load. It is better to serve most people than to try serving every expensive query.
Match infrastructure to latency needs. Logs can wait a few seconds, and that patience saves money.
Revisit old decisions. Zomato went from Elasticsearch to ClickHouse, then took another look at how it hosts Kafka. What fits at one scale rarely fits forever.
My take
What stuck with me after reading through Zomato’s posts is how unglamorous the winning ideas are. There’s no exotic technology here. It’s a queue to absorb spikes, workers that batch writes, and a database chosen for the job. The real engineering is in the small decisions, like committing offsets only after an insert succeeds, or killing expensive queries so everyone else’s still work. I also like that the story didn’t end with ClickHouse. Years later, Zomato’s parent company was reportedly taking another look at how it hosts Kafka. Architecture is never finished, only right for a given scale and budget. If I were building a logging pipeline from scratch, I’d start with this pattern and add complexity only when the numbers force me to.
Does Zomato use Kafka for logs? Yes. According to Zomato's engineering blog, logs are buffered in Kafka before custom Go workers insert them into ClickHouse.
How many logs does Zomato generate? In 2023 the team reported over 50 TB uncompressed per day, peaking at 150 million events per minute.
Why did Zomato move from Elasticsearch to ClickHouse? Rising cost and operational pain as log volume grew. The team reported savings of over a million dollars a year.
Is Zomato still using the same setup? I can't say. The sources are from 2023 to 2026, and the figures may have changed.
Sources and further reading
Zomato Data Platform Team, Building a cost-effective logging platform using ClickHouse for petabyte scale (July 2023): https://www.zomato.com/blog/building-a-cost-effective-logging-platform-using-clickhouse-for-petabyte-scale/
Quastor, How Zomato built a Petabyte Scale Logging System: https://blog.quastor.org/p/zomato-built-petabyte-scale-logging-system
Zomato, A Tale of Scale: Behind the Scenes at Zomato Tech for NYE 2023: https://www.zomato.com/blog/a-tale-of-scale-behind-the-scenes-at-zomato-tech-for-nye-2023/
WarpStream, Eternal Saves 60+%, Simplifies Ops, and Logs 25 GiB/s With WarpStream (August 2026): https://www.warpstream.com/blog/eternal-case-study
ClickHouse Bangalore Meetup talk by Anmol Virmani and Palash Goel: https://clickhouse.com/videos/zomatos-logging-platform-journey
AWS Open Source Blog, How Zomato Boosted Performance 25% and Cut Compute Cost 30% Migrating Trino and Druid Workloads to AWS Graviton: https://aws.amazon.com/blogs/opensource/how-zomato-boosted-performance-25-and-cut-compute-cost-30-migrating-trino-and-druid-workloads-to-aws-graviton
Hashnode, Building a High-Performance Log Ingestor with Go and ClickHouse: https://hashnode-hub.vercel.app/posts/680dc9be9857d73795b7ddad
Note: figures are as reported by the sources above at the time of publication and may have changed.