Latency spikes are the kind of bug that does not show up in your unit tests, not even in your “average latency” dashboards.
It shows up in the product. Users feel it as “Discord is laggy today” even if your p50 looks fine.
Discord had this exact problem in their Read States service (the thing that tracks what channels/messages you have read).
This service is basically always in the hot path: on connect, on message send, on message read. So even small slowdowns become a daily pain for millions of people.
Their Go version was fast most of the time, but every few minutes it would spike hard. Not random either. Roughly every 2 minutes: CPU jumps, latency jumps, user experience dies for a moment.
The root cause is very Go-ish: the garbage collector. In this service they keep a huge LRU cache in memory (millions of users, tens of millions of read state objects, hundreds of thousands of cache updates per second). When entries get evicted, memory is not freed immediately. It hangs around until GC decides it is safe to reclaim.
Even if your code “allocates very little”, GC can still hurt you because scanning costs are real. Go can also force a GC cycle at a minimum interval (so you still get periodic work), and when your heap has a massive object graph (like a huge cache), the collector has to walk it to prove what is alive. That “walk” is the tax.
They tried tuning GC percent. Nothing changed because they were not allocating fast enough to trigger more frequent smaller cycles. They tried shrinking caches, partitioning caches. That reduced spikes, but created a new tradeoff: smaller cache means more cache misses, which means more database reads, which pushes p99 up. Classic distributed systems moment: you fix one pain and another pain appears.
So they rewrote that service in Rust.
Rust’s big win here is predictable memory behavior. No runtime GC sweeping your heap every couple minutes. When a read state entry is evicted from the LRU, it is dropped and freed right there (ownership model makes this tractable and safe). Less surprise work happening at random times, so tail latency improves.
They also took a bet on async Rust. Back then, async on stable was not as smooth, so Discord used nightly + tokio because for a networked service you need async to scale without wasting threads. They accepted the pain because the upside was huge, and later stable async caught up.
Even a basic Rust port matched the heavily hand-tuned Go version, and after some profiling it beat Go on latency, CPU, and memory. They did practical optimizations like changing some structures (BTreeMap vs HashMap for memory behavior), swapping metrics libraries to reduce contention, reducing copies. Then they raised cache capacity way higher because no GC means no “scan the world” penalty.
The service got so fast their graphs moved from milliseconds to microseconds for average paths.
---
Go is amazing for getting things shipped fast. But if you are running something that is
1) always hot path,
2) huge in-memory structures, and
3) strict p99/p999 requirements,
then GC pauses and scan work can become a product issue.
Rust costs more brain upfront. But it buys you something pretty cool in production: performance you can predict. That is why Discord switched this specific service.
---
I am learning rust from time to time. Live. Consider following if you are into this. And btw here is the blog link:
https://t.co/23X7EniT7H
I am giving you free access to my complete 50 Days SQL Superstar Program.
The earlier SQL playlist helped millions, but interviews today need more depth.
So I am rebuilding everything from scratch to help you crack top product based companies.
I am also organising it in one clean portal with daily videos, notes, datasets, quizzes and certificates.
35 days are already live.
To get the enrolment link just:
- Follow me so that I can DM you
- Like and Retweet
- Comment "SQL Superstar"
Free access available for a limited time.
These 50 days can change your life!
#sql #dataengineering #databases
We are launching a 5-Day AI Agents course on Kaggle.
Learn about AI Agent patterns, agent tools, context engineering, memory management, agent evaluations and building production grade multi-agent systems with A2A.
100% free and open to all.
Stay tuned for more such interesting posts → @Saboo_Shubham_
I have created 100+ AI Agents and RAG tutorials, 100% free and opensource.
P.S: Don't forget to star the repo to show your support 🌟
https://t.co/b0211AIBIh
There’s a new breed of GenAI Application Engineers who can build more-powerful applications faster than was possible before, thanks to generative AI. Individuals who can play this role are highly sought-after by businesses, but the job description is still coming into focus. Let me describe their key skills, as well as the sorts of interview questions I use to identify them.
Skilled GenAI Application Engineers meet two primary criteria: (i) They are able to use the new AI building blocks to quickly build powerful applications. (ii) They are able to use AI assistance to carry out rapid engineering, building software systems in dramatically less time than was possible before. In addition, good product/design instincts are a significant bonus.
AI building blocks. If you own a lot of copies of only a single type of Lego brick, you might be able to build some basic structures. But if you own many types of bricks, you can combine them rapidly to form complex, functional structures. Software frameworks, SDKs, and other such tools are like that. If all you know is how to call a large language model (LLM) API, that's a great start. But if you have a broad range of building block types — such as prompting techniques, agentic frameworks, evals, guardrails, RAG, voice stack, async programming, data extraction, embeddings/vectorDBs, model fine tuning, graphDB usage with LLMs, agentic browser/computer use, MCP, reasoning models, and so on — then you can create much richer combinations of building blocks.
The number of powerful AI building blocks continues to grow rapidly. But as open-source contributors and businesses make more building blocks available, staying on top of what is available helps you keep on expanding what you can build. Even though new building blocks are created, many building blocks from 1 to 2 years ago (such as eval techniques or frameworks for using vectorDBs) are still very relevant today.
AI-assisted coding. AI-assisted coding tools enable developers to be far more productive, and such tools are advancing rapidly. Github Copilot, first announced in 2021 (and made widely available in 2022), pioneered modern code autocompletion. But shortly after, a new breed of AI-enabled IDEs such as Cursor and Windsurf offered much better code-QA and code generation. As LLMs improved, these AI-assisted coding tools that were built on them improved as well.
Now we have highly agentic coding assistants such as OpenAI’s Codex and Anthropic’s Claude Code (which I really enjoy using and find impressive in its ability to write code, test, and debug autonomously for many iterations). In the hands of skilled engineers — who don’t just “vibe code” but deeply understand AI and software architecture fundamentals and can steer a system toward a thoughtfully selected product goal — these tools make it possible to build software with unmatched speed and efficiency.
I find that AI-assisted coding techniques become obsolete much faster than AI building blocks, and techniques from 1 or 2 years ago are far from today's best practices. Part of the reason for this might be that, while AI builders might use dozens (hundreds?) of different building blocks, they aren’t likely to use dozens of different coding assistance tools at once, and so the forces of Darwinian competition are stronger among tools. Given the massive investments in this space by Anthropic, Google, OpenAI, and other players, I expect the frenetic pace of development to continue, but keeping up with the latest developments in AI-assisted coding tools will pay off, since each generation is much better than the last.
Bonus: Product skills. In some companies, engineers are expected to take pixel-perfect drawings of a product, specified in great detail, and write code to implement it. But if a product manager has to specify even the smallest detail, this slows down the team. The shortage of AI product managers exacerbates this problem. I see teams move much faster if GenAI Engineers also have some user empathy as well at basic skill at designing products, so that, given only high-level guidance on what to build (“a user interface that lets users see their profiles and change their passwords”), they can make a lot of decisions themselves and build at least a prototype to iterate from.
When interviewing GenAI Application Engineers, I will usually ask about their mastery of AI building blocks and ability to use AI-assisted coding, and sometimes also their product/design instincts. One additional question I've found highly predictive of their skill is, “How do you keep up with the latest developments in AI?” Because AI is evolving so rapidly, someone with good strategies for keeping up — such as reading The Batch and taking short courses 😃, regular hands-on practice building projects, and having a community to talk to — really does stay ahead of the game.
[Original post: https://t.co/I3alxNs0vn ]
Hi Friends, I need your HELP.
My technical books - System Design Interview Vol 1, Vol 2, and Machine Learning System Design Interview - are being illegally sold on Amazon .in (Amazon India).
I’ve been battling this issue for months. My publisher and I have filed dozens of copyright claims, conducted test purchases, and collected evidence - but the problem persists. I feel lost and helpless.
100% of my books sold on Amazon .in (Amazon India) are pirated copies. This means:
- More and more developers are receiving low-quality, pirated books
- The pirates profit off my hard work
- My books are getting hundreds of incorrect 1-star reviews due to piracy
The pirated books are linked to my Amazon listings, so reviews meant for the pirates end up on my product pages.
If you are in India, the books are now exclusively sold through Shroff Publishers.
You can help by:
- Sharing the post to spread awareness as widely as possible
- If you work at Amazon, please help escalate the issue
This issue means so much to me as an author. Thank you for reading and for your help.
Kerala: PM Modi acknowledges NS Rajappan, a differently-abled man based in Kochi, for his effort to fish out plastic bottles from Lake Vembanad, in 'Mann ki Baat' address
"I feel honoured to have been mentioned by the Prime Minister in his Mann ki Baat address," says Rajappan
After leaving his failed startup, @wenbinf started working on an old side project.
And he ended up growing it into a profitable API business.
In this story, he shares how he accidentally built Listen API, what tech he used, & what he's learned from it.
https://t.co/LGvfNeT0Ea
Don't dare say "But the system worked" when a majority of Republicans in Congress support the overturning of a free and fair election. You don't celebrate a cancer not having killed you yet. You celebrate when you're cancer free.
Have you ever heard the sound of a rocket falling before it lights its engines? I hadn’t either... JUST WAIT TILL YOU HEAR THE BOOM! 😉 Here’s a teaser of one of one of our videos. @considercosmos and I are releasing 4K videos this weekend!!! 😍 #SN8@spacex@elonmusk
Dr. Fauci isn't just one of our foremost experts on combating viruses—he is a good man and a tireless public servant. He has served six presidents and led us through some of our toughest challenges.
Our administration, and our country, will be stronger because of his guidance.
My dad used to say, “Joey, I don’t expect the government to solve my problems. But I expect it to understand my problems.”
Folks out there aren’t looking for a handout — they just need help. They’re in trouble through no fault of their own, and they need us to understand.
Wow! Just captured my most detailed International Space Station lunar transit photo to date.
Crew Dragon Resilience is barely distinguishable at the top-center of the station.
Taken with a Orion 10” Dobsonian telescope + 2x Barlow lens on a Nikon D500 in Lakeland, Florida.