Skip to content

Commit 9cdd24d

Browse files
committed
Update styling in List and Tables for rate-limiting-token-bucket-leaky-bucket-implementation article
1 parent b1cc27a commit 9cdd24d

2 files changed

Lines changed: 95 additions & 54 deletions

File tree

  • src/content/articles/rate-limiting-token-bucket-leaky-bucket-implementation

‎src/content/articles/rate-limiting-token-bucket-leaky-bucket-implementation/index.mdx‎

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ I watched this play out at a company that implemented per-IP rate limiting at 10
1818

1919
The fix? They combined __sliding window counter__ (to eliminate the boundary problem) with __token bucket__ for burst control. Same traffic spike: requests distributed smoothly, everyone got served, the backend hummed along at capacity without falling over.
2020

21-
The naive approach—"block anything over N requests"—fails because it treats rate limiting as a wall instead of a valve. The algorithms matter, but __where__ you limit and __how__ you identify clients matter more.
21+
The naive approach — _"block anything over N requests"_ — fails because it treats rate limiting as a wall instead of a valve. The algorithms matter, but _where_ you limit and _how_ you identify clients matter more.
2222

2323
## Where to Rate Limit
2424

2525
Most rate limiting articles jump straight to algorithms. But the strategic question — where in your stack to enforce limits — often matters more than which algorithm you choose.
2626

2727
<Table
28-
variant="vertical-column-delineation-table"
28+
variant="numbered-review-table"
2929
content={{
30+
figure: 'Rate limiting layers comparison.',
3031
thead: {
3132
th: ['Layer', 'Tools', 'Granularity', 'Best For'],
3233
},
@@ -40,22 +41,21 @@ Most rate limiting articles jump straight to algorithms. But the strategic quest
4041
th: 'API Gateway',
4142
td: ['AWS API Gateway, Kong, nginx', 'API key, route', 'API quotas, tiered plans'],
4243
},
43-
{
44-
th: 'Service Mesh',
45-
td: ['Istio, Envoy, Linkerd', 'Service identity', 'Service-to-service limits'],
46-
},
4744
{
4845
th: 'Application',
4946
td: ['Custom middleware', 'User, action, context', 'Fine-grained business logic'],
5047
},
48+
{
49+
th: 'Service Mesh',
50+
td: ['Istio, Envoy, Linkerd', 'Service identity', 'Service-to-service limits'],
51+
},
5152
],
5253
},
53-
figure: 'Rate limiting layers comparison.',
5454
}}
5555
/>
5656

5757
<List
58-
variant="check-icons-list"
58+
variant="numbered-with-background-list"
5959
items={[
6060
{
6161
lead: 'Edge rate limiting',
@@ -104,7 +104,8 @@ Code: Token bucket core logic.
104104
Here's how traffic patterns play out with a 10-token bucket refilling at 1 token per second:
105105

106106
<Table
107-
variant="vertical-column-delineation-table"
107+
variant="grid-and-accent-header-table"
108+
fullWidth={false}
108109
content={{
109110
thead: {
110111
th: ['Traffic Pattern', 'What Happens'],
@@ -142,7 +143,7 @@ For distributed systems, you need atomic operations. The standard pattern is a R
142143
The rate limiting key — how you identify who's making requests — is as important as the algorithm. Choose wrong, and you'll either punish legitimate users or fail to stop abuse.
143144

144145
<List
145-
variant="check-icons-list"
146+
variant="zebra-list"
146147
items={[
147148
{
148149
lead: 'IP address',
@@ -156,7 +157,11 @@ Header spoofing is trivial: `curl -H "X-Forwarded-For: 1.2.3.4" your-api.com`. I
156157
</Callout>
157158

158159
<List
159-
variant="check-icons-list"
160+
variant="zebra-list"
161+
classes={{
162+
ul: "!divide-y-0 !border-0 !overflow-visible !rounded-none space-y-4",
163+
li: "!rounded-lg !border border-trim",
164+
}}
160165
items={[
161166
{
162167
lead: 'API key',
@@ -194,7 +199,10 @@ Rate limiting is a valve, not a wall. The best rate limiters are invisible to no
194199
Three takeaways:
195200

196201
<List
197-
variant="check-icons-list"
202+
variant="side-by-side-list"
203+
classes={{
204+
wrapper: "sm:ml-6 sm:mr-12 mb-6",
205+
}}
198206
items={[
199207
{
200208
lead: 'Layer appropriately',

0 commit comments

Comments
 (0)