What Happens When You Don’t Rate Limit Your API (and How Token Buckets Fix It)
medium.com·20h·
Discuss: r/golang
🐹Go
Preview
Report Post

12 min readJust now

When you deploy your first API, it feels like something real has shipped. You’ve tested your endpoints, your JSON is valid, and the responses are coming back in millisecond. Everything feels smooth until thousands of requests come flooding in instantly.

Press enter or click to view image in full size

Image Source: https://stytch.com/blog/api-rate-limiting/

It starts with a slight spike in latency. A specific endpoint, maybe the search function or the image uploader starts taking two hundred milliseconds instead of twenty milliseconds. Then, the CPU usage graph on your admin dashboard, which was hovering at 5% suddenly shoots up to 70% or even higher. The memory usage climbs the mountain.

Suddenly logs are no…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help