
title: How I Accidentally DDoS'd My Own API (And the 2-Line React Fix) 🤡
We've all been there. You spend days building a "bulletproof" backend. You set up a strict Rate Limiter to protect your database from malicious bots and DDoS attacks. You feel like a Cybersecurity mastermind. 🛡️ Then, you open your own app, type a few words into the search bar, and... your backend blocks YOU. Yep, I accidentally DDoS'd myself. If you want to see the exact moment my backend decided to fight back, check out this quick 30-second Short I made about the incident: (Wait, what actually happened?) The Crime: Friendly Fire I was building a search feature for my platform, DotSuite. I wanted the search results to update automatically as the user typed. So, I wrote a standard useEffect in React to fetch the data whenever the search state changed. The result? For every single keystroke, my React frontend fired a new API request. Typing "dotsuite" didn't send 1 request. It sent 8 requests in less than a second. My backend saw this massive spike in traffic, panicked, and did exactly
Continue reading on Dev.to React
Opens in a new tab




