Delivered-To: tjphuhs@gmail.com
Received: by 2002:a5d:51c9:0:b0:451:8158:aa77 with SMTP id n9csp516130wrv;
        Wed, 13 May 2026 08:41:38 -0700 (PDT)
X-Received: by 2002:a05:6a00:ad0b:b0:837:e9cc:d474 with SMTP id d2e1a72fcca58-83f03e87948mr4444537b3a.2.1778686897849;
        Wed, 13 May 2026 08:41:37 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1778686897; cv=none;
        d=google.com; s=arc-20240605;
        b=XhdtP4/R1l3P+mCaSRMVUq6fCftDgUXlU3HhGJdLC2GrtyIVllSYH7SAr0ZjRsEU7D
         62j47WlGbUhopaDKctu7gOKC/HBoManhEqcpm97AunlgUv/lptJDd4g9FhpCJg8bkjgB
         CGyVI4EjmMw7LQBli3YWDZ2w99LVsuwamCbH6z96YPYMo1XIqBsJhgmUBrERCIBb01hU
         rS2XTWddN7POV/GqeoW/tGbGIg4tTOerhle9JFlICUdV2XAlwy4ROziZb7oZ/lBvgRns
         wyCRnAeEGmkNyvMolD/LMvcmASvXPLGPgTZj/zJj2b3FcALL945xUVwgmXwabYZKRJrZ
         3yIg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
        h=list-unsubscribe-post:list-unsubscribe:list-post:list-id
         :list-archive:list-url:list-owner:reply-to:in-reply-to:references
         :sender:feedback-id:date:message-id:to:from:subject:mime-version
         :dkim-signature:dkim-signature;
        bh=LqUbMsWPbVOOcUkZuxru0itlB+kmYh6TpBY01tjBMws=;
        fh=9zP21OW67FFZD2VV42mGudo540Qp4aalMWxJB5kMYug=;
        b=O1qlX8bFETCE4v021uOqvG6RRIGshdzzu5PPjAjDy87Z+KwVc3095RtXCE1riYu4a1
         fnLOg+3jCtw6X5FKhd/uTCvee2EiHkGENa8zS9Cni0n8vv3jZg8CgOgIlKhSDuYQLfpr
         Qg5wy+4tYXf8Wsyga/gVgcJaLhquXBjRAu5QB4r2G3D0J0DyDRyiZg25uIGung91VtNG
         I7nje0Qwx0IK5/WOhV0UjbDILhFqyuSUvrgM8QpcAt2vCVmBkTscOdI9Uu+HjWsk1OWA
         rYQ/kzunXHLWbju19aoLEka1ervrsKwmTlIXfAJayUEmrbji44I1iyuaIggs01U0VBJn
         yvpg==;
        dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@mg-d0.substack.com header.s=mailo header.b=HRSRG8PR;
       dkim=pass header.i=@mailgun.org header.s=mg header.b="H/y73NIk";
       spf=pass (google.com: domain of bounce+91e48a.63af5d-tjphuhs=gmail.com@mg-d0.substack.com designates 161.38.202.253 as permitted sender) smtp.mailfrom="bounce+91e48a.63af5d-tjphuhs=gmail.com@mg-d0.substack.com";
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=substack.com
Return-Path: <bounce+91e48a.63af5d-tjphuhs=gmail.com@mg-d0.substack.com>
Received: from mg-202-253.substack.com (mg-202-253.substack.com. [161.38.202.253])
        by mx.google.com with UTF8SMTPS id d2e1a72fcca58-83965646075si58600012b3a.39.2026.05.13.08.41.37
        for <tjphuhs@gmail.com>
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 13 May 2026 08:41:37 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounce+91e48a.63af5d-tjphuhs=gmail.com@mg-d0.substack.com designates 161.38.202.253 as permitted sender) client-ip=161.38.202.253;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@mg-d0.substack.com header.s=mailo header.b=HRSRG8PR;
       dkim=pass header.i=@mailgun.org header.s=mg header.b="H/y73NIk";
       spf=pass (google.com: domain of bounce+91e48a.63af5d-tjphuhs=gmail.com@mg-d0.substack.com designates 161.38.202.253 as permitted sender) smtp.mailfrom="bounce+91e48a.63af5d-tjphuhs=gmail.com@mg-d0.substack.com";
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=substack.com
DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg-d0.substack.com; q=dns/txt; s=mailo; t=1778686897; x=1778694097;
 h=List-Unsubscribe-Post: List-Unsubscribe: List-Post: List-Id: List-Archive: List-Owner: Reply-To: In-Reply-To: References: Sender: Sender: Date: Message-Id: To: To: From: From: Subject: Subject: Content-Type: Mime-Version: X-Feedback-Id;
 bh=LqUbMsWPbVOOcUkZuxru0itlB+kmYh6TpBY01tjBMws=;
 b=HRSRG8PRImZMHzgmukedmRqDryfDNKfJlycBkJZ/uZ3m/iltFAnl77hhEmP+HZ85LdGAPxnYiBTaBzavPxxGOv9PBZthNq71sC4dxahvdXGxu6hn+uKDBILHZymIm77LYEzVvxmoMWja89kPoBe8G3/OLc4xytJwgVPX1ejU1eA=
DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mailgun.org; q=dns/txt; s=mg; t=1778686897; x=1778694097;
 h=List-Unsubscribe-Post: List-Unsubscribe: List-Post: List-Id: List-Archive: List-Owner: Reply-To: In-Reply-To: References: Sender: Sender: Date: Message-Id: To: To: From: From: Subject: Subject: Content-Type: Mime-Version: X-Feedback-Id;
 bh=LqUbMsWPbVOOcUkZuxru0itlB+kmYh6TpBY01tjBMws=;
 b=H/y73NIkZv53BM9bKBjL5NlUF9IadGrLWxBfKugq0LUcfMcf8/n9cCZjUQXN6jmHXHKMAvQjw4hErvENcwACy/hkKb8dyfQeGlGNiNJdu4Y1zRAxk8gqdgX1HssgsyJcfVcrCkg2iMOTlRJGsEueNvNO1PMib06kGQ+RacHOE4s=
X-Mailgun-Sid: WyJkZWU4NyIsInRqcGh1aHNAZ21haWwuY29tIiwiNjNhZjVkIl0=
X-Feedback-Id: postmaster@mg-d0.substack.com:post:6148c7d8a45790427cda307f:mailgun
Received: by 3acb09075aed2b6d4898a615eca5c7f7f87624a0663d21f37eec85cfa2308b9a with HTTP
 id 6a049bb1efae4a7485db71be; Wed, 13 May 2026 15:41:37 GMT
X-Mailgun-Sending-Ip: 161.38.202.253
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="666e983acfd920f457cd93c2dc0675c6c14992e5b9e30eb00ffa296535ba"
Subject: High Performance Rate Limiting at Databricks
From: ByteByteGo <bytebytego@substack.com>
To: tjphuhs@gmail.com
X-Mailgun-Tag: post
X-Mailgun-Track-Clicks: false
Message-Id: <20260513153035.3.f13c7bbf59bd8f5c@mg-d0.substack.com>
Date: Wed, 13 May 2026 15:30:35 +0000
Feedback-Id: post-196936594:cat-post:pub-817132:substack
Sender: ByteByteGo <bytebytego@substack.com>
References: <post-196936594@substack.com>
In-Reply-To: <post-196936594@substack.com>
Reply-To: ByteByteGo
 <reply+39918y&4iwoe6&&160ca37718c676d629bb8efa62b1add17d30907ee4e6950d247fbaffc062ddd6@mg1.substack.com>
List-Owner: <mailto:bytebytego@substack.com>
List-Url: <https://blog.bytebytego.com/>
List-Archive: <https://blog.bytebytego.com/archive>
List-Id: <bytebytego.substack.com>
List-Post: <https://blog.bytebytego.com/p/high-performance-rate-limiting-at>
List-Unsubscribe: <https://blog.bytebytego.com/action/disable_email/disable?token=eyJ1c2VyX2lkIjoyNzM2MjIzOTgsInBvc3RfaWQiOjE5NjkzNjU5NCwiaWF0IjoxNzc4Njg2ODk3LCJleHAiOjE4MTAyMjI4OTcsImlzcyI6InB1Yi04MTcxMzIiLCJzdWIiOiJkaXNhYmxlX2VtYWlsIn0.d2H0NzxwoRlSzK_wsdpBTY3KwM6GXsKYtE6LPmwo-Ks&all_sections=true>
List-Unsubscribe-Post: List-Unsubscribe=One-Click
X-Mailgun-Variables: {"category": "post", "email_generated_at": "1778686897118", "is_freemail":
 "true", "post_audience": "everyone", "post_id": "196936594", "post_type":
 "newsletter", "pub_community_enabled": "true", "publication_id": "817132",
 "subdomain": "bytebytego", "user_id": "273622398"}

--666e983acfd920f457cd93c2dc0675c6c14992e5b9e30eb00ffa296535ba
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

View this post on the web at https://blog.bytebytego.com/p/high-performance=
-rate-limiting-at

ScyllaDB Founders Share What Real-Time AI Requires from the Database (Spons=
ored) [ https://substack.com/redirect/cc973a24-c008-4be2-a06b-86d5eca83aba?=
j=3DeyJ1IjoiNGl3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs ]
AI is pushing databases to their limits; learn what it takes to stay ahead
AI workloads are exposing the limits of what most databases were designed t=
o handle. Databases will need to process petabytes of data, millions of wri=
tes per second, and data types like vectors =E2=80=93 all while delivering =
consistent sub-millisecond P99 latency.
Join ScyllaDB co-founders Dor Laor (CEO) and Avi Kivity (CTO) to explore wh=
at real-time AI workloads actually require, and what it takes to stay ahead=
=2E
You will learn:
How AI workloads are shifting in real-world applications
The specific pressures these new patterns place on databases
What architectural features help teams meet AI=E2=80=99s demands
In early 2023, the Databricks rate limiter ran on a simple architecture. An=
 Envoy ingress gateway made calls to a Ratelimit Service, which in turn que=
ried a single Redis instance. The setup handled the traffic it was designed=
 for, and the per-second nature of rate limiting meant the counts could sta=
y transient without any durability guarantee.
Then, the real-time model serving was launched. A single customer could now=
 generate orders of magnitude more traffic than the service was built for, =
and three specific cracks appeared.
Tail latency climbed sharply under load, worsened by two network hops and a=
 P99 of 10 to 20 milliseconds between services in one cloud provider.
Adding machines and bolting on caches stopped helping past a certain point.
The single Redis instance also represented a single point of failure that t=
he team could no longer tolerate.
The team redesigned the service, and the rebuild merits attention because t=
he most interesting part is what they chose to give up.
Strict accuracy is expensive at scale, and Databricks traded it for a faste=
r critical path, a horizontally scalable counter, and a rate limiter that a=
nswers as if the decision has already been made by the time the client chec=
ks.
In this article, we look at how Databricks implemented rate limiting at sca=
le, how they shrank the critical path, and the accuracy tradeoff that shrin=
king usually requires.
Disclaimer: This post is based on publicly shared details from the Databric=
ks Engineering Team. Please comment if you notice any inaccuracies.
A Counting Problem
Strip away the framing, and rate limiting reduces to a counting problem. Ea=
ch request arrives, the system locates the right counter, compares it again=
st a threshold, and either allows or rejects the request. The design questi=
on is where that counter is stored and how quickly it works.
In the old Databricks architecture, the counter was stored in Redis. See th=
e diagram below:
A request flowed through Envoy, hit the Ratelimit Service, and triggered a =
call to Redis. That meant two network hops on the critical path of every re=
quest. In a cloud provider where P99 network latency sat between 10 and 20 =
milliseconds, those hops dominated the rate limit decision time. A check th=
at should have cost microseconds was costing tens of milliseconds.
See the diagram below:
The team had already tried to work around this. Envoy can be configured wit=
h consistent hashing so that requests with the same key land on the same Ra=
telimit Service instance, which lets that instance keep a local count. The =
approach helped, but it hit three walls.
Non-Envoy services could not participate in the scheme, which fragmented th=
e rate limit view.
When the service cluster scaled up or restarted, the hash assignments churn=
ed, which forced regular syncs back to Redis.
Lastly, consistent hashing can be prone to hotspotting, where one very popu=
lar key saturates a single machine while its neighbours sit idle. The only =
way to push through those hotspots was to over-provision the entire cluster=
=2E
This is where scaling stops being additive. Adding machines stopped moving =
the latency numbers, and adding more caching introduced more inconsistency.=
 The architecture itself was the ceiling, and the team had to change it.
Moving the Count In-memory
Rate limiting is transient. A per-second count exists only as long as that =
second is current, and the moment it rolls over, the old value becomes irre=
levant.
That property opens a door. If a count only needs to live for a second, dur=
able storage is more than the problem requires. The count can live in memor=
y on the server that owns it, and losing that server during a restart costs=
 almost nothing.
The challenge is that a single server cannot hold counts for every rate lim=
it key across the fleet. The service needs a way to partition keys across s=
ervers, and a way for any client to quickly find the server that owns a giv=
en key.
That is the problem Dicer solves at Databricks. For the purposes of this di=
scussion, Dicer can be treated as a black box. Dicer is a routing layer tha=
t lets a service keep state in memory while remaining horizontally scalable=
 and fault-tolerant. Clients ask Dicer which server owns a given key, and t=
hat server confirms it is the authoritative owner before handling the reque=
st.
See the diagram below:
With Dicer in place, the Ratelimit Service could move every counter in-memo=
ry. The network hop to Redis disappeared. Server-side tail latency came dow=
n sharply, and the team could scale horizontally by adding replicas to Dice=
r=E2=80=99s assignment pool. The single point of failure went away as well,=
 because each replica became the authoritative store for its own slice of k=
eys. Restarts and scale events redistributed ownership without any external=
 coordination, and the churn that had forced Redis syncs in the old consist=
ent hashing setup stopped having an impact.
This solved one problem and exposed another.
The server side was now fast, but the client side still made a synchronous =
call across the network for every single request. A rate limit check that h=
ad been waiting on Redis was now waiting on the Rate Limit Service. The P99=
 came down, but the shape of the problem remained. The critical path still =
had a round trip on it.
Optimistic Rate Limiting
This is where the team made its most consequential move.
Millions of client requests per second were still translating into millions=
 of synchronous calls to the Ratelimit Service. Even with the server answer=
ing in memory, that represented significant network traffic, significant se=
rver capacity, and significant client-side waiting. The team asked a harder=
 question.
Does every request truly need to wait for a rate limit decision before proc=
eeding?
They considered three alternatives:
The first was prefetching tokens on the client, where the client pulls a bl=
ock of capacity and answers rate limit checks locally.
The second was batching requests on the client and waiting for a response b=
efore releasing them.
The third was sampling, where only a fraction of requests get checked.
Each had problems. Prefetching carries messy edge cases during startup, exp=
iry, and token exhaustion. Batching adds delay and memory pressure. Samplin=
g works for high-QPS limits but falls apart when the limit itself is small.
What the team built is called batch-reporting, and it rests on two ideas:
The first is that clients make no remote calls on the rate limit path.
The second is optimistic rate limiting, where the default is to allow the r=
equest and reject only when the client already has a reason to reject from =
an earlier report.
The client counts how many requests it let through and how many it rejected=
, grouped by rate limit key. Every 100 milliseconds or so, a background thr=
ead packages those counts and reports them to the Ratelimit Service. The se=
rver responds with instructions telling the client which keys should be rej=
ected, until which timestamp, and at what rejection rate.
The diagram below shows the three architectures side by side:
The impact was substantial:
Tail latency on rate limit calls fell by roughly a factor of ten, because t=
he calls were effectively free for the client.
Spiky inbound traffic turned into constant outbound reports because the rep=
orting cadence is fixed regardless of how bursty the underlying traffic bec=
omes.
Server-side load became predictable for the first time.
The inversion merits emphasis. The rate limiter used to be asked before eac=
h decision. Now it is told after. That inversion sits at the core of the re=
design, and the tradeoff is explicit. Databricks accepts that some requests=
 over the limit will slip through between reports, and their backends are b=
uilt to tolerate that overshoot.
Bounding The Overshoot
Batch-reporting introduced a problem of its own.
Between the moment a client starts exceeding a limit and the moment the ser=
ver tells it to reject, traffic can leak through. A hundred milliseconds of=
 overshoot at high QPS amounts to a lot of requests. The team wanted guaran=
tees that kept overshoot within roughly 5 percent of the policy, and reachi=
ng that target required three-layered fixes.
The first was a rejection rate returned by the server. The idea is to use t=
he past to predict the near future. If the last second=E2=80=99s traffic ex=
ceeded the policy by some amount, the formula rejectionRate equals (estimat=
edQps minus rateLimitPolicy) divided by estimatedQps tells the client what =
fraction of upcoming requests to drop. This assumes that the next second=E2=
=80=99s traffic resembles the last second=E2=80=99s, which often holds true=
 to help.
The second was a client-side local rate limiter as a defense in depth. When=
 traffic spikes so obviously that the batch cycle has no chance of catching=
 up, the client starts rejecting locally based on its own counts. This catc=
hes the extreme cases immediately rather than waiting for a round trip.
The third was the algorithm itself. Once autosharding lets the service hold=
 counts in memory, the token bucket becomes feasible. The token bucket has =
a useful property that a fixed window lacks. Fixed window resets to zero at=
 the end of every interval, so a customer can blast traffic right at a wind=
ow boundary and technically stay within the policy while sending double the=
 intended rate during the crossover. The token bucket continuously fills an=
d drains, and it can go negative. When a customer sends too many requests, =
the bucket remembers and stays empty until the refill catches up. The reset=
 problem disappears. Token bucket also approximates a sliding window when c=
onfigured without extra burst capacity, which produces a stricter shape tha=
n a fixed window for most limits.
This is where the algorithm choice was gated by the storage choice. Token b=
ucket needs compare-and-set style logic on every increment, which was slow =
in Redis. In-memory, the same operation is close to free. Once the token bu=
cket was viable, the earlier rejection rate mechanism became unnecessary, a=
nd the team eventually converted every rate limit in the system to a token =
bucket.
Three Coupled Decisions
The Databricks story resolves into three decisions that depend on each othe=
r:
The first is the algorithm, which determines how the counter behaves at the=
 boundaries of time intervals. Fixed window, sliding window, and token buck=
et each produce different behaviour in that regard.
The second is where the state lives, whether in a shared external store lik=
e Redis, in an in-memory counter on a single server, or in an in-memory cou=
nter sharded across a cluster of servers through some routing layer.
The third is the sync model, which can either require every request to wait=
 for a synchronous decision or allow clients to make local decisions and re=
concile through asynchronous reports.
The old Databricks architecture sat at one corner of that space, combining =
a fixed window, shared Redis, and synchronous per-request checks. The new a=
rchitecture sits at a different corner, combining token bucket, sharded in-=
memory storage, and asynchronous batch reports.
The dependency chain is worth understanding. Token bucket needs cheap compa=
re-and-set semantics, which rules out Redis at the QPS Databricks sees, whi=
ch forces in-memory state. In-memory state across many counters forces shar=
ding, because one server cannot hold everything. Sharding with authoritativ=
e per-key ownership is what enables batch-reporting, because each shard can=
 act as the source of truth for its keys without coordinating with peers.
These constraints explain the order of the rollout. Sharded in-memory came =
first, batch-reporting followed on top of it, and token bucket replaced the=
 algorithm once the state architecture could support it.
Conclusion
The end result is a rate limiter that is faster, more resilient, and more s=
calable than what came before, at the cost of strict accuracy. That tradeof=
f is the foundation of the design.
A system that has to enforce limits exactly, because each request over the =
limit costs real money or violates a contract, would have to pick a differe=
nt architecture. Databricks could afford this one because their backends to=
lerate roughly 5 percent overshoot.
A few smaller details from the rollout are worth noting. The team built a l=
ocalhost sidecar next to the Envoy ingress to host the batch-reporting logi=
c, because Envoy is third-party code they could not change directly. Before=
 in-memory counting was ready, a Lua script on Redis batched writes togethe=
r to keep batch-reporting latency manageable during the migration.
The rebuild reframes what rate limiting is as a system problem.
The algorithm tends to get the attention, but the storage and sync model de=
termine whether the algorithm can run at scale. Distributed counting is a s=
ingle design problem with three coupled aspects rather than three independe=
nt ones.
References:
High Performance Ratelimiting at Databricks [ https://substack.com/redirect=
/b90befee-bbce-4d6e-85b9-5921c48697b7?j=3DeyJ1IjoiNGl3b2U2In0.sVDxRtmZ85v8k=
fdamY0krRXGMy3p768BWtuZifRB-Zs ]

Unsubscribe https://substack.com/redirect/2/eyJlIjoiaHR0cHM6Ly9ibG9nLmJ5dGV=
ieXRlZ28uY29tL2FjdGlvbi9kaXNhYmxlX2VtYWlsP3Rva2VuPWV5SjFjMlZ5WDJsa0lqb3lOek=
0yTWpJek9UZ3NJbkJ2YzNSZmFXUWlPakU1Tmprek5qVTVOQ3dpYVdGMElqb3hOemM0TmpnMk9Ea=
zNMQ0psZUhBaU9qRTRNVEF5TWpJNE9UY3NJbWx6Y3lJNkluQjFZaTA0TVRjeE16SWlMQ0p6ZFdJ=
aU9pSmthWE5oWW14bFgyVnRZV2xzSW4wLmQySDBOenh3b1JsU3pLX3dzZHBCVFkzS3dNNkdYc0t=
ZdEU2TFBtd28tS3MiLCJwIjoxOTY5MzY1OTQsInMiOjgxNzEzMiwiZiI6dHJ1ZSwidSI6MjczNj=
IyMzk4LCJpYXQiOjE3Nzg2ODY4OTcsImV4cCI6MjA5NDI2Mjg5NywiaXNzIjoicHViLTAiLCJzd=
WIiOiJsaW5rLXJlZGlyZWN0In0.fOLHTBQexV2x2a83iBNke3lzIJMcoNb4tZd33PcWWfE?
--666e983acfd920f457cd93c2dc0675c6c14992e5b9e30eb00ffa296535ba
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html lang=3D"en" dir=3D"ltr" style=3D"scrollbar-width: thin;scrollbar-colo=
r: rgb(219,219,219)rgb(255,255,255);"><head><meta charset=3D"utf-8"><title>=
High Performance Rate Limiting at Databricks</title><style>
@media (max-width: 1024px) {
  .typography .pullquote-align-left,
  .typography.editor .pullquote-align-left,
  .typography .pullquote-align-right,
  .typography.editor .pullquote-align-right,
  .typography .pullquote-align-wide,
  .typography.editor .pullquote-align-wide,
  .typography .pullquote-align-center,
  .typography.editor .pullquote-align-center {
    float: none;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
  }
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  .typography .markup table.image-wrapper img,
  .typography.editor .markup table.image-wrapper img,
  .typography .markup table.kindle-wrapper img,
  .typography.editor .markup table.kindle-wrapper img {
    max-width: 550px;
  }
}
@media (min-width: 1024px) {
  .typography:not(:has(#toc)) .captioned-image-container figure:has(> a.ima=
ge2-offset-left),
  .typography.editor:not(:has(#toc)) .captioned-image-container figure:has(=
> a.image2-offset-left) {
    margin-left: var(--image-offset-margin);
  }
  .typography:not(:has(#toc)) .captioned-image-container figure:has(> a.ima=
ge2-offset-right),
  .typography.editor:not(:has(#toc)) .captioned-image-container figure:has(=
> a.image2-offset-right) {
    margin-right: var(--image-offset-margin);
  }
}
@media (min-width: 1300px) {
  .typography .captioned-image-container figure:has(> a.image2-offset-left)=
,
  .typography.editor .captioned-image-container figure:has(> a.image2-offse=
t-left) {
    margin-left: var(--image-offset-margin);
  }
  .typography .captioned-image-container figure:has(> a.image2-offset-right=
),
  .typography.editor .captioned-image-container figure:has(> a.image2-offse=
t-right) {
    margin-right: var(--image-offset-margin);
  }
}
@media (max-width: 1024px) {
  .typography,
  .typography.editor {
    /* Disable offset on mobile/tablet */
  }
  .typography .captioned-image-container figure:has(> a.image2-align-left),
  .typography.editor .captioned-image-container figure:has(> a.image2-align=
-left),
  .typography .captioned-image-container figure:has(> a.image2-align-right)=
,
  .typography.editor .captioned-image-container figure:has(> a.image2-align=
-right) {
    float: none;
    margin: 1em auto;
    max-width: 100%;
    width: auto;
    padding: 0;
  }
  .typography .captioned-image-container figure:has(> a.image2-align-left.t=
hefp),
  .typography.editor .captioned-image-container figure:has(> a.image2-align=
-left.thefp),
  .typography .captioned-image-container figure:has(> a.image2-align-right.=
thefp),
  .typography.editor .captioned-image-container figure:has(> a.image2-align=
-right.thefp) {
    margin: 1em auto;
  }
  .typography .captioned-image-container figure:has(> a.image2-offset-left)=
,
  .typography.editor .captioned-image-container figure:has(> a.image2-offse=
t-left),
  .typography .captioned-image-container figure:has(> a.image2-offset-right=
),
  .typography.editor .captioned-image-container figure:has(> a.image2-offse=
t-right) {
    margin: 1em auto;
  }
  .typography .captioned-image-container figure:has(> a.image2-align-left) =
=2Eimage2-inset,
  .typography.editor .captioned-image-container figure:has(> a.image2-align=
-left) .image2-inset,
  .typography .captioned-image-container figure:has(> a.image2-align-right)=
 .image2-inset,
  .typography.editor .captioned-image-container figure:has(> a.image2-align=
-right) .image2-inset {
    display: block;
    justify-content: initial;
  }
}
@media (max-width: 768px) {
  .typography .markup div.sponsorship-campaign-embed,
  .typography.editor .markup div.sponsorship-campaign-embed {
    margin-top: 24px;
    margin-bottom: 24px;
  }
  .typography .markup div.sponsorship-campaign-embed:first-child,
  .typography.editor .markup div.sponsorship-campaign-embed:first-child {
    margin-top: 0px;
  }
}
@media screen and (max-width: 650px) {
  .typography .markup div.youtube-overlay,
  .typography.editor .markup div.youtube-overlay,
  .typography .markup div.vimeo-overlay,
  .typography.editor .markup div.vimeo-overlay {
    display: none !important;
  }
}
@media screen and (max-width: 370px) {
  .typography .markup div.tiktok-wrap,
  .typography.editor .markup div.tiktok-wrap {
    width: calc(95vw - 32px);
    height: calc((95vw - 32px - 2px) / 0.485714);
  }
}
@media screen and (max-width: 650px) {
  .typography .markup div.embedded-publication-wrap .embedded-publication.s=
how-subscribe,
  .typography.editor .markup div.embedded-publication-wrap .embedded-public=
ation.show-subscribe {
    padding: 24px;
  }
}
@media screen and (max-width: 650px) {
  .typography .markup div.subscription-widget-wrap .subscription-widget.sho=
w-subscribe,
  .typography.editor .markup div.subscription-widget-wrap .subscription-wid=
get.show-subscribe,
  .typography .markup div.subscription-widget-wrap-editor .subscription-wid=
get.show-subscribe,
  .typography.editor .markup div.subscription-widget-wrap-editor .subscript=
ion-widget.show-subscribe,
  .typography .markup div.captioned-button-wrap .subscription-widget.show-s=
ubscribe,
  .typography.editor .markup div.captioned-button-wrap .subscription-widget=
=2Eshow-subscribe {
    padding: 0px 24px;
  }
}
@media screen and (max-width: 650px) {
  .typography .markup div.subscription-widget-wrap .subscription-widget.sho=
w-subscribe .subscription-widget-subscribe .button,
  .typography.editor .markup div.subscription-widget-wrap .subscription-wid=
get.show-subscribe .subscription-widget-subscribe .button,
  .typography .markup div.subscription-widget-wrap-editor .subscription-wid=
get.show-subscribe .subscription-widget-subscribe .button,
  .typography.editor .markup div.subscription-widget-wrap-editor .subscript=
ion-widget.show-subscribe .subscription-widget-subscribe .button,
  .typography .markup div.captioned-button-wrap .subscription-widget.show-s=
ubscribe .subscription-widget-subscribe .button,
  .typography.editor .markup div.captioned-button-wrap .subscription-widget=
=2Eshow-subscribe .subscription-widget-subscribe .button {
    padding: 10px 12px;
    min-width: 110px;
  }
}
@media (max-width: 650px) {
  .typography .markup .twitter-embed,
  .typography.editor .markup .twitter-embed,
  .typography .markup .tweet,
  .typography.editor .markup .tweet {
    padding: 12px;
  }
}
@media (max-width: 650px) {
  .typography .markup .twitter-embed .tweet-text,
  .typography.editor .markup .twitter-embed .tweet-text,
  .typography .markup .tweet .tweet-text,
  .typography.editor .markup .tweet .tweet-text {
    font-size: 14px;
    line-height: 20px;
  }
}
@media (max-width: 650px) {
  .typography .markup .twitter-embed .tweet-photos-container.two,
  .typography.editor .markup .twitter-embed .tweet-photos-container.two,
  .typography .markup .tweet .tweet-photos-container.two,
  .typography.editor .markup .tweet .tweet-photos-container.two,
  .typography .markup .twitter-embed .tweet-photos-container.three,
  .typography.editor .markup .twitter-embed .tweet-photos-container.three,
  .typography .markup .tweet .tweet-photos-container.three,
  .typography.editor .markup .tweet .tweet-photos-container.three,
  .typography .markup .twitter-embed .tweet-photos-container.four,
  .typography.editor .markup .twitter-embed .tweet-photos-container.four,
  .typography .markup .tweet .tweet-photos-container.four,
  .typography.editor .markup .tweet .tweet-photos-container.four {
    height: 200px;
  }
}
@media (max-width: 650px) {
  .typography .markup .twitter-embed a.expanded-link .expanded-link-img,
  .typography.editor .markup .twitter-embed a.expanded-link .expanded-link-=
img,
  .typography .markup .tweet a.expanded-link .expanded-link-img,
  .typography.editor .markup .tweet a.expanded-link .expanded-link-img {
    max-height: 180px;
  }
}
@media (max-width: 650px) {
  .typography .markup .twitter-embed a.expanded-link .expanded-link-descrip=
tion,
  .typography.editor .markup .twitter-embed a.expanded-link .expanded-link-=
description,
  .typography .markup .tweet a.expanded-link .expanded-link-description,
  .typography.editor .markup .tweet a.expanded-link .expanded-link-descript=
ion {
    display: none;
  }
}
@media screen and (max-width: 650px) {
  .typography .markup .apple-podcast-container,
  .typography.editor .markup .apple-podcast-container {
    width: unset;
  }
}
@media (max-width: 420px) {
  .typography .markup .install-substack-app-embed img.install-substack-app-=
embed-img,
  .typography.editor .markup .install-substack-app-embed img.install-substa=
ck-app-embed-img {
    margin: 0 auto 16px auto;
  }
}
@media (max-width: 420px) {
  .typography .markup .install-substack-app-embed .install-substack-app-emb=
ed-text,
  .typography.editor .markup .install-substack-app-embed .install-substack-=
app-embed-text {
    margin: 0 0 12px 0;
    max-width: 100%;
    width: auto;
    text-align: center;
  }
}
@media (max-width: 420px) {
  .typography .markup .install-substack-app-embed .install-substack-app-emb=
ed-link,
  .typography.editor .markup .install-substack-app-embed .install-substack-=
app-embed-link {
    display: flex;
    justify-content: center;
  }
}
@media screen and (min-width: 481px) {
  .share-button-container {
    height: 38px;
  }
}
@media screen and (min-width: 481px) {
  .share-button-container a.comment {
    height: 38px;
    line-height: 38px;
    padding-right: 10px;
  }
}
@media screen and (max-width: 480px) {
  .share-button-container .separator {
    display: block;
    margin: 0;
    height: 8px;
    border-left: none;
  }
}
@media screen and (max-width: 480px) {
  .share-button-container a.share.first img {
    padding-left: 0;
  }
}
@media screen and (min-width: 481px) {
  .share-button-container a.mobile {
    display: none !important;
  }
}
@media screen and (min-width: 541px) {
  .settings-add-pub-modal-wrapper .container .add-recommending-pub-modal-co=
ntainer {
    padding: 36px;
    height: 680px;
  }
}
@media screen and (min-width: 541px) {
  .settings-add-pub-modal-wrapper .container .add-recommending-pub-modal-co=
ntainer .footer {
    position: absolute;
    bottom: 36px;
    margin: 0px;
  }
}
@media screen and (max-width: 650px) {
  .header-anchor-parent {
    display: none;
  }
}
@media screen and (max-width: 768px) {
  .post {
    padding: 16px 0 0 0;
  }
}
@media screen and (max-width: 650px) {
  .post .post-header .post-label {
    margin-top: 8px;
  }
}
@media screen and (max-width: 650px) {
  .post .post-header .meta-author-wrap.alternative-meta .meta-right-column =
=2Epost-meta {
    margin-top: 6px;
  }
}
@media screen and (max-width: 650px) {
  .post .footer-facepile-container {
    height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
  }
}
@media screen and (max-width: 650px) {
  .post .post-footer.use-separators {
    justify-content: center;
  }
}
@media screen and (max-width: 650px) {
  .post .post-footer.next-prev {
    height: 64px;
    justify-content: space-between;
    box-sizing: border-box;
  }
}
@media screen and (max-width: 650px) {
  .post-contributor-footer .post-contributor-bio-table {
    display: block;
  }
  .post-contributor-footer .post-contributor-bio-table-row {
    display: flex;
    flex-direction: row;
  }
  .post-contributor-footer .post-contributor-bio-userhead-cell,
  .post-contributor-footer .post-contributor-bio-body-cell {
    display: block;
  }
  .post-contributor-footer .post-contributor-bio-body-cell {
    flex-grow: 1;
  }
  .post-contributor-footer .post-contributor-bio-body-table {
    display: block;
  }
  .post-contributor-footer .post-contributor-bio-body-table-row {
    display: block;
  }
  .post-contributor-footer .post-contributor-bio-copy-cell,
  .post-contributor-footer .post-contributor-bio-controls-cell {
    display: block;
  }
  .post-contributor-footer .post-contributor-bio-copy-cell {
    margin: 0 0 16px 0;
  }
  .post-contributor-footer .post-contributor-bio-controls-cell {
    width: auto;
  }
  .post-contributor-footer .post-contributor-bio-controls {
    margin: auto;
  }
  .post-contributor-footer .post-contributor-bio-controls .button.primary {
    width: 100%;
  }
  .post-contributor-footer .post-contributor-bio-text {
    font-size: 14px;
  }
}
@media screen and (min-width: 768px) {
  .post-silhouette {
    padding: 32px 0;
  }
}
@media screen and (max-width: 650px) {
  .post-silhouette .post-silhouette-title {
    margin-top: 10.44225025px;
    height: 120px;
  }
}
@media screen and (max-width: 650px) {
  .post-silhouette .post-silhouette-meta {
    width: 75%;
  }
}
@media screen and (max-width: 650px) {
  .post-silhouette .post-silhouette-meta.with-byline-image {
    margin: 20px 0;
  }
}
@media screen and (max-width: 650px) {
  .use-theme-bg .post-meta.alternative-meta .post-meta-item,
  .post-meta.alternative-meta .post-meta-item {
    padding-right: 16px;
  }
}
@media screen and (max-width: 370px) {
  .use-theme-bg .post-meta.alternative-meta .post-meta-item,
  .post-meta.alternative-meta .post-meta-item {
    font-size: 14px;
  }
}
@media screen and (max-width: 650px) {
  .use-theme-bg .post-meta.alternative-meta .post-meta-item.guest-author-pu=
blication,
  .post-meta.alternative-meta .post-meta-item.guest-author-publication {
    display: none;
  }
}
@media screen and (max-width: 370px) {
  .post-meta .post-meta-item .post-meta-button {
    height: 36px !important;
    /* important to override in-line height style on emails */
  }
  .post-meta .post-meta-item .post-meta-button .meta-button-label {
    display: none;
  }
  .post-meta .post-meta-item .post-meta-button > svg {
    margin-right: 0;
  }
}
@media screen and (max-width: 370px) {
  .post-meta .post-meta-item {
    font-size: 12px;
  }
}
@media screen and (max-width: 650px) {
  .post .floating-subscribe-button {
    bottom: 20px;
    right: 20px;
  }
}
@media (max-width: 1024px) {
  body .pullquote-align-left,
  body .pullquote-align-right,
  body .pullquote-align-wide,
  body .pullquote-align-center {
    float: none;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
  }
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  body .markup table.image-wrapper img,
  body .markup table.kindle-wrapper img {
    max-width: 550px;
  }
}
@media (min-width: 1024px) {
  body:not(:has(#toc)) .captioned-image-container figure:has(> a.image2-off=
set-left) {
    margin-left: var(--image-offset-margin);
  }
  body:not(:has(#toc)) .captioned-image-container figure:has(> a.image2-off=
set-right) {
    margin-right: var(--image-offset-margin);
  }
}
@media (min-width: 1300px) {
  body .captioned-image-container figure:has(> a.image2-offset-left) {
    margin-left: var(--image-offset-margin);
  }
  body .captioned-image-container figure:has(> a.image2-offset-right) {
    margin-right: var(--image-offset-margin);
  }
}
@media (max-width: 1024px) {
  body {
    /* Disable offset on mobile/tablet */
  }
  body .captioned-image-container figure:has(> a.image2-align-left),
  body .captioned-image-container figure:has(> a.image2-align-right) {
    float: none;
    margin: 1em auto;
    max-width: 100%;
    width: auto;
    padding: 0;
  }
  body .captioned-image-container figure:has(> a.image2-align-left.thefp),
  body .captioned-image-container figure:has(> a.image2-align-right.thefp) =
{
    margin: 1em auto;
  }
  body .captioned-image-container figure:has(> a.image2-offset-left),
  body .captioned-image-container figure:has(> a.image2-offset-right) {
    margin: 1em auto;
  }
  body .captioned-image-container figure:has(> a.image2-align-left) .image2=
-inset,
  body .captioned-image-container figure:has(> a.image2-align-right) .image=
2-inset {
    display: block;
    justify-content: initial;
  }
}
@media (max-width: 768px) {
  body .markup div.sponsorship-campaign-embed {
    margin-top: 24px;
    margin-bottom: 24px;
  }
  body .markup div.sponsorship-campaign-embed:first-child {
    margin-top: 0px;
  }
}
@media screen and (max-width: 650px) {
  body .markup div.youtube-overlay,
  body .markup div.vimeo-overlay {
    display: none !important;
  }
}
@media screen and (max-width: 370px) {
  body .markup div.tiktok-wrap {
    width: calc(95vw - 32px);
    height: calc((95vw - 32px - 2px) / 0.485714);
  }
}
@media screen and (max-width: 650px) {
  body .markup div.embedded-publication-wrap .embedded-publication.show-sub=
scribe {
    padding: 24px;
  }
}
@media screen and (max-width: 650px) {
  body .markup div.subscription-widget-wrap .subscription-widget.show-subsc=
ribe,
  body .markup div.subscription-widget-wrap-editor .subscription-widget.sho=
w-subscribe,
  body .markup div.captioned-button-wrap .subscription-widget.show-subscrib=
e {
    padding: 0px 24px;
  }
}
@media screen and (max-width: 650px) {
  body .markup div.subscription-widget-wrap .subscription-widget.show-subsc=
ribe .subscription-widget-subscribe .button,
  body .markup div.subscription-widget-wrap-editor .subscription-widget.sho=
w-subscribe .subscription-widget-subscribe .button,
  body .markup div.captioned-button-wrap .subscription-widget.show-subscrib=
e .subscription-widget-subscribe .button {
    padding: 10px 12px;
    min-width: 110px;
  }
}
@media (max-width: 650px) {
  body .markup .twitter-embed,
  body .markup .tweet {
    padding: 12px;
  }
}
@media (max-width: 650px) {
  body .markup .twitter-embed .tweet-text,
  body .markup .tweet .tweet-text {
    font-size: 14px;
    line-height: 20px;
  }
}
@media (max-width: 650px) {
  body .markup .twitter-embed .tweet-photos-container.two,
  body .markup .tweet .tweet-photos-container.two,
  body .markup .twitter-embed .tweet-photos-container.three,
  body .markup .tweet .tweet-photos-container.three,
  body .markup .twitter-embed .tweet-photos-container.four,
  body .markup .tweet .tweet-photos-container.four {
    height: 200px;
  }
}
@media (max-width: 650px) {
  body .markup .twitter-embed a.expanded-link .expanded-link-img,
  body .markup .tweet a.expanded-link .expanded-link-img {
    max-height: 180px;
  }
}
@media (max-width: 650px) {
  body .markup .twitter-embed a.expanded-link .expanded-link-description,
  body .markup .tweet a.expanded-link .expanded-link-description {
    display: none;
  }
}
@media screen and (max-width: 650px) {
  body .markup .apple-podcast-container {
    width: unset;
  }
}
@media (max-width: 420px) {
  body .markup .install-substack-app-embed img.install-substack-app-embed-i=
mg {
    margin: 0 auto 16px auto;
  }
}
@media (max-width: 420px) {
  body .markup .install-substack-app-embed .install-substack-app-embed-text=
 {
    margin: 0 0 12px 0;
    max-width: 100%;
    width: auto;
    text-align: center;
  }
}
@media (max-width: 420px) {
  body .markup .install-substack-app-embed .install-substack-app-embed-link=
 {
    display: flex;
    justify-content: center;
  }
}
@media screen and (min-width: 500px) {
  body .header a.logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
}
@media screen and (max-width: 420px) {
  body .subscription-receipt table:first-of-type .subscription-amount .subs=
cription-discount {
    width: 72px !important;
  }
}
@media screen and (min-width: 481px) {
  body .share-button-container {
    height: auto;
  }
}
@media screen and (max-width: 480px) {
  body .share-button-container .separator {
    display: block !important;
    margin: 0 !important;
    height: 8px !important;
    border-left: none !important;
  }
}
@media screen and (max-width: 650px) {
  .digest .item .post-meta-item.audience {
    display: none;
  }
}
@media screen and (min-width: 500px) {
  .digest-publication .logo img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }
}
@media screen and (max-width: 650px) {
  .comments-page .container .comment-list .collapsed-reply {
    margin-left: calc(10 + 32px - 24px);
  }
}
@media screen and (max-width: 650px) {
  .comment > .comment-list {
    padding-left: 24px;
  }
}
@media screen and (max-width: 650px) {
  .finish-magic-login-modal .modal-content .container {
    padding: 24px 0;
  }
}
@media (max-width: 650px) {
  .reader2-text-b3 {
    line-height: 24px;
  }
}
@media screen and (max-width: 650px) {
  .reader2-text-h4 {
    line-height: 24px;
  }
}
@media screen and (min-width: 541px) {
  .user-profile-modal {
    padding-left: 12px;
    padding-right: 12px;
  }
}
@media screen and (max-width: 650px) {
  .subscribe-widget form.form .sideBySideWrap button.rightButton {
    padding: 10px 12px;
  }
}
@media screen and (min-width: 541px) {
  .pub-icon:hover .logo-hover,
  .feed-item-icon:hover .logo-hover {
    display: block;
  }
}
@media screen and (max-width: 650px) {
  .post-ufi.single-full-width-button .post-ufi-button-wrapper {
    width: 100%;
    padding: 16px;
  }
  .post-ufi.single-full-width-button .post-ufi-button-wrapper:empty {
    display: none;
  }
  .post-ufi.single-full-width-button .post-ufi-button {
    width: 100%;
    justify-content: center;
  }
}
@media screen and (max-width: 768px) {
  .file-embed-wrapper {
    padding: 0;
  }
}
@media screen and (max-width: 768px) {
  .file-embed-wrapper-editor {
    padding: 0;
  }
}
@media screen and (max-width: 768px) {
  .file-embed-wrapper-editor:active {
    padding: 0;
  }
}
@media only screen and (max-width: 650px) {
  .file-embed-button.wide,
  .file-embed-error-button.wide {
    display: none;
  }
}
@media only screen and (min-width: 630px) {
  .file-embed-button.narrow,
  .file-embed-error-button.narrow {
    display: none;
  }
}
@media screen and (min-width: 541px) {
  .audio-player-wrapper .audio-player {
    min-width: 500px;
  }
}
@media screen and (max-width: 650px) {
  .audio-player-wrapper .audio-player .audio-player-progress {
    border-left-width: 16px;
    border-right-width: 16px;
  }
}
@media screen and (max-width: 650px) {
  .audio-player-wrapper .audio-player .audio-player-progress .audio-player-=
progress-bar .audio-player-progress-bar-popup {
    top: -54px;
  }
}
@media screen and (max-width: 650px) {
  .audio-player-wrapper-fancy .audio-player .audio-player-progress {
    border-left-width: 16px;
    border-right-width: 16px;
  }
}
@media screen and (max-width: 650px) {
  .audio-player-wrapper-fancy .audio-player .audio-player-progress .audio-p=
layer-progress-bar .audio-player-progress-bar-popup {
    top: -54px;
  }
}
@media (min-width: 250px) {
  .audio-player-wrapper-fancy .audio-player {
    padding: 32px;
  }
  .audio-player-wrapper-fancy .audio-player .btn-group {
    display: flex;
  }
  .audio-player-wrapper-fancy .audio-player .btn-group .button:last-of-type=
 {
    display: block;
  }
}
@media (min-width: 300px) {
  .audio-player-wrapper-fancy .audio-player .btn-group {
    display: block;
  }
  .audio-player-wrapper-fancy .audio-player .btn-group .button:first-of-typ=
e {
    display: block;
  }
}
@media (min-width: 350px) {
  .audio-player-wrapper-fancy .audio-player .audio-player-substack-logo {
    display: block;
  }
  .audio-player-wrapper-fancy .audio-player .audio-player-title {
    margin-top: 16px;
  }
  .audio-player-wrapper-fancy .audio-player .audio-player-hero-image-contai=
ner {
    padding-top: 15%;
    width: 15%;
    display: block;
  }
  .audio-player-wrapper-fancy .audio-player .btn-group .button:first-of-typ=
e {
    display: block;
  }
  .audio-player-wrapper-fancy .audio-player .audio-player-substack-logo {
    display: block;
  }
}
@media (min-width: 350px) {
  .audio-player-wrapper-fancy .audio-player .audio-player-hero-image-contai=
ner {
    padding-top: 25%;
    width: 25%;
    display: block;
  }
  .audio-player-wrapper-fancy .audio-player .btn-group {
    display: flex;
  }
  .audio-player-wrapper-fancy .audio-player .btn-group .button:first-of-typ=
e {
    display: block;
  }
}
@media (min-width: 400px) {
  .audio-player-wrapper-fancy .audio-player .audio-player-hero-image-contai=
ner {
    padding-top: 40%;
    width: 40%;
  }
}
@media (max-width: 400px) {
  .audio-player-wrapper-fancy .audio-player .btn-group {
    margin-top: 12px;
  }
  .audio-player-wrapper-fancy .audio-player .btn-group .button {
    font-size: 13px;
    padding: 6px 12px;
    height: auto;
    margin-top: 10px;
  }
}
@media (min-width: 600px) {
  .audio-player-wrapper-fancy .audio-player .audio-player-hero-image-contai=
ner {
    padding-top: 55%;
    width: 55%;
  }
}
@media (max-width: 650px) {
  .poll-editor-modal {
    min-width: calc(100% - 20px);
  }
}
@media (max-width: 750px) {
  .poll-embed .poll-anchor-target .poll-anchor-copy-button {
    left: 8px;
    top: 45px;
  }
}
@media not all and (min-resolution: 0.001dpcm) {
  @supports (-webkit-appearance: none) {
    p a:not(.primary.button),
    .post p:not(.button-wrapper) a:not(.primary.button),
    .footnote a.footnote-anchor:not(.primary.button),
    .thread-head .markup p:not(.button-wrapper) a:not(.primary.button) {
      color: #7756e3;
      text-decoration: none;
    }
    p a:not(.primary.button):hover,
    .post p:not(.button-wrapper) a:not(.primary.button):hover,
    .footnote a.footnote-anchor:not(.primary.button):hover,
    .thread-head .markup p:not(.button-wrapper) a:not(.primary.button):hove=
r {
      text-decoration: underline;
    }
  }
}</style></head><body class=3D"email-body" style=3D"font-kerning: auto;--im=
age-offset-margin: -120px;"><img src=3D"https://eotrx.substackcdn.com/o/ce7=
2c9fafae17aab/p.gif?token=3DeyJtIjoiPDIwMjYwNTEzMTUzMDM1LjMuZjEzYzdiYmY1OWJ=
kOGY1Y0BtZy1kMC5zdWJzdGFjay5jb20-IiwidSI6MjczNjIyMzk4LCJyIjoidGpwaHVoc0BnbW=
FpbC5jb20iLCJkIjoibWctZDAuc3Vic3RhY2suY29tIiwicCI6MTk2OTM2NTk0LCJ0IjoibmV3c=
2xldHRlciIsImEiOiJldmVyeW9uZSIsInMiOjgxNzEzMiwiYyI6InBvc3QiLCJmIjp0cnVlLCJw=
b3NpdGlvbiI6InRvcCIsImlhdCI6MTc3ODY4Njg5NywiZXhwIjoxNzgxMjc4ODk3LCJpc3MiOiJ=
wdWItMCIsInN1YiI6ImVvIn0.vsoy41CAadM-tyXZ7Cye4q6g52Tk_eeiURVus2zIxug" alt=
=3D"" width=3D"1" height=3D"1" border=3D"0" style=3D"height:1px !important;=
width:1px !important;border-width:0 !important;margin-top:0 !important;marg=
in-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;p=
adding-top:0 !important;padding-bottom:0 !important;padding-right:0 !import=
ant;padding-left:0 !important;"/><div class=3D"preview" style=3D"display:no=
ne;font-size:1px;color:#333333;line-height:1px;max-height:0px;max-width:0px=
;opacity:0;overflow:hidden;">In this article, we look at how Databricks imp=
lemented rate limiting at scale, how they shrank the critical path, and the=
 accuracy tradeoff that shrinking usually requires.</div><div class=3D"prev=
iew" style=3D"display:none;font-size:1px;color:#333333;line-height:1px;max-=
height:0px;max-width:0px;opacity:0;overflow:hidden;">&#847; &nbsp; &#8199; =
&#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp;=
 &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#84=
7; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &=
#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; =
&#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847=
; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#=
173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &=
#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847;=
 &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#1=
73;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#=
8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; =
&nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#17=
3;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8=
199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &=
nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173=
;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#81=
99; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &n=
bsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;=
&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#819=
9; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nb=
sp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&=
#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199=
; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbs=
p; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#=
847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199;=
 &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp=
; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#8=
47; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; =
&#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp;=
 &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#84=
7; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &=
#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; =
&#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847=
; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#=
173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &=
#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847;=
 &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#1=
73;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#=
8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; =
&nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#17=
3;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8=
199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &=
nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173=
;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#81=
99; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &n=
bsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;=
&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#819=
9; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nb=
sp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&=
#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199=
; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbs=
p; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#=
847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199;=
 &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp=
; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#8=
47; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; =
&#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp;=
 &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#84=
7; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &=
#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; =
&#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847=
; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#=
173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &=
#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847;=
 &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#1=
73;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#=
8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; =
&nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#17=
3;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8=
199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &=
nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173=
;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#81=
99; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &n=
bsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;&#847; &nbsp; &#8199; &#173;=
&#847; &nbsp; &#8199; &#173;</div><table class=3D"email-body-container" rol=
e=3D"presentation" width=3D"100%" border=3D"0" cellspacing=3D"0" cellpaddin=
g=3D"0"><tbody><tr><td></td><td class=3D"content" width=3D"550"></td><td></=
td></tr><tr><td></td><td class=3D"content" width=3D"550" align=3D"left"><di=
v style=3D"font-size: 16px;line-height: 26px;max-width: 550px;width: 100%;m=
argin: 0 auto;overflow-wrap: break-word;"><table role=3D"presentation" widt=
h=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"><tbody><tr><td =
align=3D"right" style=3D"height:20px;"><table role=3D"presentation" width=
=3D"auto" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"><tbody><tr><td s=
tyle=3D"vertical-align:middle;"><span class=3D"pencraft pc-reset reset-IxiV=
JZ tw-font-body tw-text-ssm tw-text-substack-secondary" style=3D"font-famil=
y: SF Pro Text, -apple-system, system-ui, BlinkMacSystemFont, Inter, Segoe =
UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji=
, Segoe UI Symbol;font-size: 13px;color: unset;list-style: none;text-decora=
tion: unset;margin: 0;"><div class=3D"pencraft pc-reset align-right-VJbKw5 =
size-12-mmZ61m reset-IxiVJZ" style=3D"list-style: none;color: unset;text-al=
ign: right;font-size: 12px;line-height: 16px;text-decoration: unset;margin:=
 0;"><span class=3D"pencraft pc-reset reset-IxiVJZ" translated=3D"" style=
=3D"list-style: none;color: unset;text-decoration: unset;margin: 0;">Forwar=
ded this email? <a class=3D"pencraft pc-reset decoration-underline-ClTkYc r=
eset-IxiVJZ" href=3D"https://substack.com/redirect/2/eyJlIjoiaHR0cHM6Ly9ibG=
9nLmJ5dGVieXRlZ28uY29tL3N1YnNjcmliZT91dG1fc291cmNlPWVtYWlsJnV0bV9jYW1wYWlnb=
j1lbWFpbC1zdWJzY3JpYmUmcj00aXdvZTYmbmV4dD1odHRwcyUzQSUyRiUyRmJsb2cuYnl0ZWJ5=
dGVnby5jb20lMkZwJTJGaGlnaC1wZXJmb3JtYW5jZS1yYXRlLWxpbWl0aW5nLWF0IiwicCI6MTk=
2OTM2NTk0LCJzIjo4MTcxMzIsImYiOnRydWUsInUiOjI3MzYyMjM5OCwiaWF0IjoxNzc4Njg2OD=
k3LCJleHAiOjIwOTQyNjI4OTcsImlzcyI6InB1Yi0wIiwic3ViIjoibGluay1yZWRpcmVjdCJ9.=
CskAU2JTFj1Howq_L02bFDD4d7j-Uz0eyqQCJUQ_m80?" style=3D"list-style: none;col=
or: unset;text-decoration: unset;margin: 0;-webkit-text-decoration-line: un=
derline;text-decoration-line: underline;">Subscribe here</a> for more</span=
></div></span></td></tr></tbody></table></td></tr></tbody></table><div clas=
s=3D"post typography" dir=3D"auto" style=3D"--image-offset-margin: -120px;p=
adding: 32px 0 0 0;font-size: 16px;line-height: 26px;"><div class=3D"post-h=
eader" role=3D"region" aria-label=3D"Post header" style=3D"font-size: 16px;=
line-height: 26px;"><h1 class=3D"post-title published title-X77sOw" dir=3D"=
auto" style=3D"direction: auto;text-align: start;unicode-bidi: isolate;colo=
r: rgb(54,55,55);font-family: 'SF Pro Display',-apple-system-headline,syste=
m-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,san=
s-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-weight:=
 bold;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: antialia=
sed;-webkit-appearance: optimizelegibility;-moz-appearance: optimizelegibil=
ity;appearance: optimizelegibility;margin: 0;line-height: 36px;font-size: 3=
2px;"><a href=3D"https://substack.com/app-link/post?publication_id=3D817132=
&post_id=3D196936594&utm_source=3Dpost-email-title&utm_campaign=3Demail-pos=
t-title&isFreemail=3Dtrue&r=3D4iwoe6&token=3DeyJ1c2VyX2lkIjoyNzM2MjIzOTgsIn=
Bvc3RfaWQiOjE5NjkzNjU5NCwiaWF0IjoxNzc4Njg2ODk3LCJleHAiOjE3ODEyNzg4OTcsImlzc=
yI6InB1Yi04MTcxMzIiLCJzdWIiOiJwb3N0LXJlYWN0aW9uIn0.xIMwGAHJcvyJua1BkB3-i7HD=
fMWxLkSLckG9s2KSyyk" style=3D"color: rgb(54,55,55);text-decoration: none;">=
High Performance Rate Limiting at Databricks</a></h1><table class=3D"post-m=
eta" role=3D"presentation" width=3D"100%" border=3D"0" cellspacing=3D"0" ce=
llpadding=3D"0" style=3D"margin: 1em 0;height: 20px;align-items: center;"><=
tbody><tr><td><table role=3D"presentation" width=3D"auto" border=3D"0" cell=
spacing=3D"0" cellpadding=3D"0"><tbody><tr><td><table role=3D"presentation"=
 width=3D"auto" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"><tbody><tr=
><td style=3D"vertical-align:middle;"><div class=3D"pencraft pc-reset color=
-primary-zABazT line-height-20-t4M0El font-meta-MWBumP size-11-NuY2Zx weigh=
t-medium-fw81nC transform-uppercase-yKDgcq reset-IxiVJZ meta-EgzBVA custom-=
css-email-post-author" style=3D"list-style: none;font-size: 11px;line-heigh=
t: 20px;text-decoration: unset;color: rgb(54,55,55);margin: 0;font-family: =
'SF Compact',-apple-system,system-ui,-apple-system,BlinkMacSystemFont,'Sego=
e UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji=
','Segoe UI Symbol';font-weight: 500;text-transform: uppercase;letter-spaci=
ng: .2px;"><a class=3D"pencraft pc-reset color-primary-zABazT line-height-2=
0-t4M0El font-meta-MWBumP size-11-NuY2Zx weight-medium-fw81nC transform-upp=
ercase-yKDgcq reset-IxiVJZ meta-EgzBVA" style=3D"list-style: none;color: rg=
b(54,55,55);margin: 0;font-size: 11px;line-height: 20px;font-family: 'SF Co=
mpact',-apple-system,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',=
Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Seg=
oe UI Symbol';font-weight: 500;text-transform: uppercase;letter-spacing: .2=
px;text-decoration: none" href=3D"https://substack.com/@bytebytego399569">B=
yteByteGo</a></div></td></tr></tbody></table></td></tr><tr><td><table role=
=3D"presentation" width=3D"auto" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0"><tbody><tr><td style=3D"vertical-align:middle;"><div class=3D"pencra=
ft pc-reset color-secondary-ls1g8s line-height-20-t4M0El font-meta-MWBumP s=
ize-11-NuY2Zx weight-medium-fw81nC transform-uppercase-yKDgcq reset-IxiVJZ =
meta-EgzBVA" style=3D"list-style: none;font-size: 11px;line-height: 20px;te=
xt-decoration: unset;color: rgb(119,119,119);margin: 0;font-family: 'SF Com=
pact',-apple-system,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',R=
oboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Sego=
e UI Symbol';font-weight: 500;text-transform: uppercase;letter-spacing: .2p=
x;"><time datetime=3D"2026-05-13T15:30:35.533Z">May 13</time></div></td></t=
r></tbody></table></td></tr></tbody></table></td><td align=3D"right"><table=
 role=3D"presentation" width=3D"auto" border=3D"0" cellspacing=3D"0" cellpa=
dding=3D"0"><tbody><tr><td style=3D"vertical-align:middle;"><a href=3D"http=
s://substack.com/@bytebytego399569"><img class=3D"custom-css-email-avatar a=
vatar-QIQ5yR" src=3D"https://substackcdn.com/image/fetch/$s_!U1Ej!,f_auto,q=
_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazon=
aws.com%2Fpublic%2Fimages%2Fc9941c68-e5b7-4b93-be75-df7cc4ffef02_504x540.pn=
g" style=3D"box-sizing: border-box;max-width: 550px;border: none;vertical-a=
lign: middle;width: 40px;height: 40px;min-width: 40px;min-height: 40px;obje=
ct-fit: cover;margin: 0px;display: inline;border-radius: 50%" width=3D"40" =
height=3D"40"></a></td></tr></tbody></table></td></tr></tbody></table><tabl=
e class=3D"email-ufi-2-top" role=3D"presentation" width=3D"100%" border=3D"=
0" cellspacing=3D"0" cellpadding=3D"0" style=3D"border-top: 1px solid rgb(0=
,0,0,.1);border-bottom: 1px solid rgb(0,0,0,.1);min-width: 100%;"><tbody><t=
r height=3D"16"><td height=3D"16" style=3D"font-size:0px;line-height:0;">&n=
bsp;</td></tr><tr><td><table role=3D"presentation" width=3D"100%" border=3D=
"0" cellspacing=3D"0" cellpadding=3D"0"><tbody><tr><td><table role=3D"prese=
ntation" width=3D"auto" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"><t=
body><tr><td style=3D"vertical-align:middle;"><table role=3D"presentation" =
width=3D"38" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"><tbody><tr><t=
d align=3D"center"><a class=3D"email-icon-button" href=3D"https://substack.=
com/app-link/post?publication_id=3D817132&post_id=3D196936594&utm_source=3D=
substack&isFreemail=3Dtrue&submitLike=3Dtrue&token=3DeyJ1c2VyX2lkIjoyNzM2Mj=
IzOTgsInBvc3RfaWQiOjE5NjkzNjU5NCwicmVhY3Rpb24iOiLinaQiLCJpYXQiOjE3Nzg2ODY4O=
TcsImV4cCI6MTc4MTI3ODg5NywiaXNzIjoicHViLTgxNzEzMiIsInN1YiI6InJlYWN0aW9uIn0.=
Y6nz6uhCstGeoDKA_uvtsBnleMH5mOIZi6-roFmL3MM&utm_medium=3Demail&utm_campaign=
=3Demail-reaction&r=3D4iwoe6" style=3D"font-family: system-ui,-apple-system=
,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Col=
or Emoji','Segoe UI Emoji','Segoe UI Symbol';display: inline-block;font-wei=
ght: 500;border: 1px solid rgb(0,0,0,.1);border-radius: 9999px;text-transfo=
rm: uppercase;font-size: 12px;line-height: 1;padding: 9px 0;text-decoration=
: none;color: rgb(119,119,119);min-width: 38px;box-sizing: border-box;width=
: 38px"><img class=3D"icon" src=3D"https://substackcdn.com/image/fetch/$s_!=
PeVs!,w_36,c_scale,f_png,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsub=
stack.com%2Ficon%2FLucideHeart%3Fv%3D4%26height%3D36%26fill%3Dnone%26stroke=
%3D%2523808080%26strokeWidth%3D2" width=3D"18" height=3D"18" style=3D"borde=
r: none;vertical-align: middle;max-width: 18px" alt=3D""></a></td></tr></tb=
ody></table></td><td width=3D"8" style=3D"min-width:8px;"></td><td style=3D=
"vertical-align:middle;"><table role=3D"presentation" width=3D"38" border=
=3D"0" cellspacing=3D"0" cellpadding=3D"0"><tbody><tr><td align=3D"center">=
<a class=3D"email-icon-button" href=3D"https://substack.com/app-link/post?p=
ublication_id=3D817132&post_id=3D196936594&utm_source=3Dsubstack&utm_medium=
=3Demail&isFreemail=3Dtrue&comments=3Dtrue&token=3DeyJ1c2VyX2lkIjoyNzM2MjIz=
OTgsInBvc3RfaWQiOjE5NjkzNjU5NCwiaWF0IjoxNzc4Njg2ODk3LCJleHAiOjE3ODEyNzg4OTc=
sImlzcyI6InB1Yi04MTcxMzIiLCJzdWIiOiJwb3N0LXJlYWN0aW9uIn0.xIMwGAHJcvyJua1BkB=
3-i7HDfMWxLkSLckG9s2KSyyk&r=3D4iwoe6&utm_campaign=3Demail-half-magic-commen=
ts&action=3Dpost-comment&utm_source=3Dsubstack&utm_medium=3Demail" style=3D=
"font-family: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,=
Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI S=
ymbol';display: inline-block;font-weight: 500;border: 1px solid rgb(0,0,0,.=
1);border-radius: 9999px;text-transform: uppercase;font-size: 12px;line-hei=
ght: 1;padding: 9px 0;text-decoration: none;color: rgb(119,119,119);min-wid=
th: 38px;box-sizing: border-box;width: 38px"><img class=3D"icon" src=3D"htt=
ps://substackcdn.com/image/fetch/$s_!x1tS!,w_36,c_scale,f_png,q_auto:good,f=
l_progressive:steep/https%3A%2F%2Fsubstack.com%2Ficon%2FLucideComments%3Fv%=
3D4%26height%3D36%26fill%3Dnone%26stroke%3D%2523808080%26strokeWidth%3D2" w=
idth=3D"18" height=3D"18" style=3D"border: none;vertical-align: middle;max-=
width: 18px" alt=3D""></a></td></tr></tbody></table></td><td width=3D"8" st=
yle=3D"min-width:8px;"></td><td style=3D"vertical-align:middle;"><table rol=
e=3D"presentation" width=3D"38" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0"><tbody><tr><td align=3D"center"><a class=3D"email-icon-button" href=
=3D"https://substack.com/app-link/post?publication_id=3D817132&post_id=3D19=
6936594&utm_source=3Dsubstack&utm_medium=3Demail&utm_content=3Dshare&utm_ca=
mpaign=3Demail-share&action=3Dshare&triggerShare=3Dtrue&isFreemail=3Dtrue&r=
=3D4iwoe6&token=3DeyJ1c2VyX2lkIjoyNzM2MjIzOTgsInBvc3RfaWQiOjE5NjkzNjU5NCwia=
WF0IjoxNzc4Njg2ODk3LCJleHAiOjE3ODEyNzg4OTcsImlzcyI6InB1Yi04MTcxMzIiLCJzdWIi=
OiJwb3N0LXJlYWN0aW9uIn0.xIMwGAHJcvyJua1BkB3-i7HDfMWxLkSLckG9s2KSyyk" style=
=3D"font-family: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Robo=
to,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe U=
I Symbol';display: inline-block;font-weight: 500;border: 1px solid rgb(0,0,=
0,.1);border-radius: 9999px;text-transform: uppercase;font-size: 12px;line-=
height: 1;padding: 9px 0;text-decoration: none;color: rgb(119,119,119);min-=
width: 38px;box-sizing: border-box;width: 38px"><img class=3D"icon" src=3D"=
https://substackcdn.com/image/fetch/$s_!_L14!,w_36,c_scale,f_png,q_auto:goo=
d,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Ficon%2FLucideShare2%3Fv=
%3D4%26height%3D36%26fill%3Dnone%26stroke%3D%2523808080%26strokeWidth%3D2" =
width=3D"18" height=3D"18" style=3D"border: none;vertical-align: middle;max=
-width: 18px" alt=3D""></a></td></tr></tbody></table></td><td width=3D"8" s=
tyle=3D"min-width:8px;"></td><td style=3D"vertical-align:middle;"><table ro=
le=3D"presentation" width=3D"38" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0"><tbody><tr><td align=3D"center"><a class=3D"email-icon-button" href=
=3D"https://substack.com/redirect/2/eyJlIjoiaHR0cHM6Ly9vcGVuLnN1YnN0YWNrLmN=
vbS9wdWIvYnl0ZWJ5dGVnby9wL2hpZ2gtcGVyZm9ybWFuY2UtcmF0ZS1saW1pdGluZy1hdD91dG=
1fc291cmNlPXN1YnN0YWNrJnV0bV9tZWRpdW09ZW1haWwmdXRtX2NhbXBhaWduPWVtYWlsLXJlc=
3RhY2stY29tbWVudCZhY3Rpb249cmVzdGFjay1jb21tZW50JnI9NGl3b2U2JnRva2VuPWV5SjFj=
MlZ5WDJsa0lqb3lOek0yTWpJek9UZ3NJbkJ2YzNSZmFXUWlPakU1Tmprek5qVTVOQ3dpYVdGMEl=
qb3hOemM0TmpnMk9EazNMQ0psZUhBaU9qRTNPREV5TnpnNE9UY3NJbWx6Y3lJNkluQjFZaTA0TV=
RjeE16SWlMQ0p6ZFdJaU9pSndiM04wTFhKbFlXTjBhVzl1SW4wLnhJTXdHQUhKY3Z5SnVhMUJrQ=
jMtaTdIRGZNV3hMa1NMY2tHOXMyS1N5eWsiLCJwIjoxOTY5MzY1OTQsInMiOjgxNzEzMiwiZiI6=
dHJ1ZSwidSI6MjczNjIyMzk4LCJpYXQiOjE3Nzg2ODY4OTcsImV4cCI6MjA5NDI2Mjg5NywiaXN=
zIjoicHViLTAiLCJzdWIiOiJsaW5rLXJlZGlyZWN0In0.GFZsI0dgsXQZRjelQFAYfhLZj1giwu=
SxqqsS_VZR0NM?&utm_source=3Dsubstack&utm_medium=3Demail" style=3D"font-fami=
ly: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,=
Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';dis=
play: inline-block;font-weight: 500;border: 1px solid rgb(0,0,0,.1);border-=
radius: 9999px;text-transform: uppercase;font-size: 12px;line-height: 1;pad=
ding: 9px 0;text-decoration: none;color: rgb(119,119,119);min-width: 38px;b=
ox-sizing: border-box;width: 38px"><img class=3D"icon" src=3D"https://subst=
ackcdn.com/image/fetch/$s_!ubXF!,w_36,c_scale,f_png,q_auto:good,fl_progress=
ive:steep/https%3A%2F%2Fsubstack.com%2Ficon%2Fnotes__NoteRestackIcon%3Fv%3D=
4%26height%3D36%26fill%3Dnone%26stroke%3D%2523808080%26strokeWidth%3D2%26st=
rokeLinecap%3Dround%26strokeLinejoin%3Dround" width=3D"18" height=3D"18" al=
t=3D"" style=3D"max-width: 550px;border: none !important;vertical-align: mi=
ddle;"></a></td></tr></tbody></table></td></tr></tbody></table></td><td ali=
gn=3D"right"><table role=3D"presentation" width=3D"auto" border=3D"0" cells=
pacing=3D"0" cellpadding=3D"0"><tbody><tr><td style=3D"vertical-align:middl=
e;"><table role=3D"presentation" width=3D"auto" border=3D"0" cellspacing=3D=
"0" cellpadding=3D"0"><tbody><tr><td align=3D"center"><a class=3D"email-but=
ton-outline" href=3D"https://open.substack.com/pub/bytebytego/p/high-perfor=
mance-rate-limiting-at?utm_source=3Demail&redirect=3Dapp-store&utm_campaign=
=3Demail-read-in-app" style=3D"font-family: system-ui,-apple-system,BlinkMa=
cSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji=
','Segoe UI Emoji','Segoe UI Symbol';display: inline-block;font-weight: 500=
;border: 1px solid rgb(0,0,0,.1);border-radius: 9999px;text-transform: uppe=
rcase;font-size: 12px;line-height: 12px;padding: 9px 14px;text-decoration: =
none;color: rgb(119,119,119);"><div class=3D"email-button-spacer" style=3D"=
font-size: 16px;line-height: 26px;display: inline-block;vertical-align: mid=
dle;max-width: 0;min-height: 18px;"></div><span class=3D"email-button-text"=
 style=3D"vertical-align: middle;margin-right: 4px">READ IN APP</span><img =
class=3D"icon text-icon" src=3D"https://substackcdn.com/image/fetch/$s_!ET-=
_!,w_36,c_scale,f_png,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubsta=
ck.com%2Ficon%2FLucideArrowUpRight%3Fv%3D4%26height%3D36%26fill%3Dnone%26st=
roke%3D%2523808080%26strokeWidth%3D2" width=3D"18" height=3D"18" style=3D"m=
in-width: 18px;min-height: 18px;border: none;vertical-align: middle;margin-=
right: 0;margin-left: 0;max-width: 18px" alt=3D""></a></td></tr></tbody></t=
able></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr heig=
ht=3D"16"><td height=3D"16" style=3D"font-size:0px;line-height:0;">&nbsp;</=
td></tr></tbody></table></div></div><div class=3D"post typography" dir=3D"a=
uto" style=3D"--image-offset-margin: -120px;padding: 32px 0 0 0;font-size: =
16px;line-height: 26px;"><div class=3D"body markup" dir=3D"auto" style=3D"t=
ext-align: initial;font-size: 16px;line-height: 26px;width: 100%;word-break=
: break-word;margin-bottom: 16px;"><h2 class=3D"header-anchor-post" style=
=3D"position: relative;font-family: 'SF Pro Display',-apple-system-headline=
,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Ari=
al,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-w=
eight: bold;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: an=
tialiased;-webkit-appearance: optimizelegibility;-moz-appearance: optimizel=
egibility;appearance: optimizelegibility;margin: 1em 0 0.625em 0;color: rgb=
(54,55,55);line-height: 1.16em;font-size: calc(1.625em * 1);margin-top: 0;"=
><a href=3D"https://substack.com/redirect/cc973a24-c008-4be2-a06b-86d5eca83=
aba?j=3DeyJ1IjoiNGl3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs" st=
yle=3D"color: rgb(54,55,55);text-decoration: underline;">ScyllaDB Founders =
Share What Real-Time AI Requires from the Database (Sponsored)</a></h2><h4 =
class=3D"header-anchor-post" style=3D"position: relative;font-family: 'SF P=
ro Display',-apple-system-headline,system-ui,-apple-system,BlinkMacSystemFo=
nt,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe =
UI Emoji','Segoe UI Symbol';font-weight: bold;-webkit-font-smoothing: antia=
liased;-moz-osx-font-smoothing: antialiased;-webkit-appearance: optimizeleg=
ibility;-moz-appearance: optimizelegibility;appearance: optimizelegibility;=
margin: 1em 0 0.625em 0;color: rgb(54,55,55);line-height: 1.16em;font-size:=
 calc(1.125em * 1);"><em>AI is pushing databases to their limits; learn wha=
t it takes to stay ahead</em></h4><div class=3D"captioned-image-container-s=
tatic" style=3D"font-size: 16px;line-height: 26px;margin: 32px auto;"><figu=
re style=3D"width: 100%;margin: 0 auto;"><table class=3D"image-wrapper" wid=
th=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" data-component=
-name=3D"Image2ToDOMStatic" style=3D"mso-padding-alt: 1em 0 1.6em;"><tbody>=
<tr><td style=3D"text-align: center;"></td><td class=3D"content" align=3D"l=
eft" width=3D"1456" style=3D"text-align: center;"><a class=3D"image-link" t=
arget=3D"_blank" href=3D"https://substack.com/redirect/cc973a24-c008-4be2-a=
06b-86d5eca83aba?j=3DeyJ1IjoiNGl3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3p768BWt=
uZifRB-Zs" style=3D"position: relative;flex-direction: column;align-items: =
center;padding: 0;width: auto;height: auto;border: none;text-decoration: no=
ne;display: block;margin: 0;"><img class=3D"wide-image" data-attrs=3D"{&quo=
t;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/image=
s/d30179ab-1c41-435d-a451-0856e9e1610f_1600x840.jpeg&quot;,&quot;srcNoWater=
mark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quo=
t;height&quot;:764,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quo=
t;bytes&quot;:376344,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type=
&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:&quot;https://go.bytebytego.=
com/ScyllaDB_051326&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quo=
t;:true,&quot;internalRedirect&quot;:&quot;https://blog.bytebytego.com/i/19=
6936594?img=3Dhttps%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2=
Fimages%2Fd30179ab-1c41-435d-a451-0856e9e1610f_1600x840.jpeg&quot;,&quot;is=
Processing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" al=
t=3D"" width=3D"550" height=3D"288.5989010989011" src=3D"https://substackcd=
n.com/image/fetch/$s_!TZ-R!,w_1100,c_limit,f_auto,q_auto:good,fl_progressiv=
e:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimage=
s%2Fd30179ab-1c41-435d-a451-0856e9e1610f_1600x840.jpeg" style=3D"border: no=
ne !important;vertical-align: middle;display: block;-ms-interpolation-mode:=
 bicubic;height: auto;margin-bottom: 0;width: auto !important;max-width: 10=
0% !important;margin: 0 auto;"></a></td><td style=3D"text-align: center;"><=
/td></tr></tbody></table></figure></div><p style=3D"margin: 0 0 20px 0;colo=
r: rgb(54,55,55);line-height: 26px;font-size: 16px;">AI workloads are expos=
ing the limits of what most databases were designed to handle. Databases wi=
ll need to process petabytes of data, millions of writes per second, and da=
ta types like vectors &#8211; all while delivering consistent sub-milliseco=
nd P99 latency.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line=
-height: 26px;font-size: 16px;">Join ScyllaDB co-founders Dor Laor (CEO) an=
d Avi Kivity (CTO) to explore what real-time AI workloads actually require,=
 and what it takes to stay ahead.</p><p style=3D"margin: 0 0 20px 0;color: =
rgb(54,55,55);line-height: 26px;font-size: 16px;">You will learn:</p><ul st=
yle=3D"margin-top: 0;padding: 0;"><li style=3D"margin: 8px 0 0 32px;mso-spe=
cial-format: bullet;"><p style=3D"color: rgb(54,55,55);line-height: 26px;ma=
rgin-bottom: 0;box-sizing: border-box;padding-left: 4px;font-size: 16px;mar=
gin: 0;">How AI workloads are shifting in real-world applications</p></li><=
li style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p style=3D"c=
olor: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: border-b=
ox;padding-left: 4px;font-size: 16px;margin: 0;">The specific pressures the=
se new patterns place on databases</p></li><li style=3D"margin: 8px 0 0 32p=
x;mso-special-format: bullet;"><p style=3D"color: rgb(54,55,55);line-height=
: 26px;margin-bottom: 0;box-sizing: border-box;padding-left: 4px;font-size:=
 16px;margin: 0;">What architectural features help teams meet AI&#8217;s de=
mands</p></li></ul><p class=3D"button-wrapper" data-attrs=3D"{&quot;url&quo=
t;:&quot;https://go.bytebytego.com/ScyllaDB_051326&quot;,&quot;text&quot;:&=
quot;Register for Free&quot;,&quot;action&quot;:null,&quot;class&quot;:null=
}" data-component-name=3D"ButtonCreateButton" style=3D"margin: 0 0 20px 0;c=
olor: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: center;cu=
rsor: pointer;border-radius: 4px;"><a class=3D"button primary" href=3D"http=
s://substack.com/redirect/cc973a24-c008-4be2-a06b-86d5eca83aba?j=3DeyJ1Ijoi=
NGl3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs" style=3D"font-fami=
ly: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,=
Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';dis=
play: inline-block;box-sizing: border-box;cursor: pointer;border: none;bord=
er-radius: 8px;font-size: 14px;line-height: 20px;font-weight: 600;text-alig=
n: center;margin: 0;opacity: 1;outline: none;white-space: nowrap;color: #ff=
ffff !important;text-decoration: none !important;background-color: #7756e3;=
padding: 12px 20px;height: auto;"><span style=3D"color: #ffffff;text-decora=
tion: none;">Register for Free</span></a></p><div style=3D"font-size: 16px;=
line-height: 26px;"><hr style=3D"margin: 32px 0;padding: 0;height: 1px;back=
ground: rgb(0,0,0,.1);border: none;"></div><p style=3D"margin: 0 0 20px 0;c=
olor: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">=
In early 2023, the Databricks rate limiter ran on a simple architecture. An=
 Envoy ingress gateway made calls to a Ratelimit Service, which in turn que=
ried a single Redis instance. The setup handled the traffic it was designed=
 for, and the per-second nature of rate limiting meant the counts could sta=
y transient without any durability guarantee.</p><p style=3D"margin: 0 0 20=
px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: jus=
tify">Then, the real-time model serving was launched. A single customer cou=
ld now generate orders of magnitude more traffic than the service was built=
 for, and three specific cracks appeared.</p><ul style=3D"margin-top: 0;pad=
ding: 0;"><li style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p=
 style=3D"color: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizin=
g: border-box;padding-left: 4px;font-size: 16px;margin: 0;text-align: justi=
fy">Tail latency climbed sharply under load, worsened by two network hops a=
nd a P99 of 10 to 20 milliseconds between services in one cloud provider.</=
p></li><li style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p st=
yle=3D"color: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: =
border-box;padding-left: 4px;font-size: 16px;margin: 0;text-align: justify"=
>Adding machines and bolting on caches stopped helping past a certain point=
=2E</p></li><li style=3D"margin: 8px 0 0=
 32px;mso-special-format: bullet;"><p=
 style=3D"color: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizin=
g: border-box;padding-left: 4px;font-size: 16px;margin: 0;text-align: justi=
fy">The single Redis instance also represented a single point of failure th=
at the team could no longer tolerate.</p></li></ul><p style=3D"margin: 0 0 =
20px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: j=
ustify">The team redesigned the service, and the rebuild merits attention b=
ecause the most interesting part is what they chose to give up.</p><p style=
=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16=
px;text-align: justify">Strict accuracy is expensive at scale, and Databric=
ks traded it for a faster critical path, a horizontally scalable counter, a=
nd a rate limiter that answers as if the decision has already been made by =
the time the client checks.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54=
,55,55);line-height: 26px;font-size: 16px;text-align: justify">In this arti=
cle, we look at how Databricks implemented rate limiting at scale, how they=
 shrank the critical path, and the accuracy tradeoff that shrinking usually=
 requires.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-heig=
ht: 26px;font-size: 16px;text-align: justify"><em>Disclaimer: This post is =
based on publicly shared details from the Databricks Engineering Team. Plea=
se comment if you notice any inaccuracies.</em></p><h2 class=3D"header-anch=
or-post" style=3D"position: relative;font-family: 'SF Pro Display',-apple-s=
ystem-headline,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto=
,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI =
Symbol';font-weight: bold;-webkit-font-smoothing: antialiased;-moz-osx-font=
-smoothing: antialiased;-webkit-appearance: optimizelegibility;-moz-appeara=
nce: optimizelegibility;appearance: optimizelegibility;margin: 1em 0 0.625e=
m 0;color: rgb(54,55,55);line-height: 1.16em;font-size: calc(1.625em * 1);t=
ext-align: justify">A Counting Problem</h2><p style=3D"margin: 0 0 20px 0;c=
olor: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">=
Strip away the framing, and rate limiting reduces to a counting problem. Ea=
ch request arrives, the system locates the right counter, compares it again=
st a threshold, and either allows or rejects the request. The design questi=
on is where that counter is stored and how quickly it works.</p><p style=3D=
"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;=
text-align: justify">In the old Databricks architecture, the counter was st=
ored in Redis. See the diagram below:</p><div class=3D"captioned-image-cont=
ainer-static" style=3D"font-size: 16px;line-height: 26px;margin: 32px auto;=
"><figure style=3D"width: 100%;margin: 0 auto;"><table class=3D"image-wrapp=
er" width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" data-co=
mponent-name=3D"Image2ToDOMStatic" style=3D"mso-padding-alt: 1em 0 1.6em;">=
<tbody><tr><td style=3D"text-align: center;"></td><td class=3D"content" ali=
gn=3D"left" width=3D"1456" style=3D"text-align: center;"><a class=3D"image-=
link" target=3D"_blank" href=3D"https://substack.com/redirect/e375e1a3-3e39=
-4a5a-b297-a0ca6b152780?j=3DeyJ1IjoiNGl3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3=
p768BWtuZifRB-Zs" style=3D"position: relative;flex-direction: column;align-=
items: center;padding: 0;width: auto;height: auto;border: none;text-decorat=
ion: none;display: block;margin: 0;"><img class=3D"wide-image" data-attrs=
=3D"{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/pub=
lic/images/17acdec1-451f-4eec-92f3-feceee3f686c_1922x1372.png&quot;,&quot;s=
rcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:=
null,&quot;height&quot;:1039,&quot;width&quot;:1456,&quot;resizeWidth&quot;=
:null,&quot;bytes&quot;:88353,&quot;alt&quot;:null,&quot;title&quot;:null,&=
quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheF=
old&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quo=
t;https://blog.bytebytego.com/i/196936594?img=3Dhttps%3A%2F%2Fsubstack-post=
-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17acdec1-451f-4eec-92f3-feceee3=
f686c_1922x1372.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:=
null,&quot;offset&quot;:false}" alt=3D"" width=3D"550" height=3D"392.479395=
6043956" src=3D"https://substackcdn.com/image/fetch/$s_!LUAU!,w_1100,c_limi=
t,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media=
=2Es3.amazonaws.com%2Fpublic%2Fimages%2=
F17acdec1-451f-4eec-92f3-feceee3f686c_=
1922x1372.png" style=3D"border: none !important;vertical-align: middle;disp=
lay: block;-ms-interpolation-mode: bicubic;height: auto;margin-bottom: 0;wi=
dth: auto !important;max-width: 100% !important;margin: 0 auto;"></a></td><=
td style=3D"text-align: center;"></td></tr></tbody></table></figure></div><=
p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-s=
ize: 16px;text-align: justify">A request flowed through Envoy, hit the Rate=
limit Service, and triggered a call to Redis. That meant two network hops o=
n the critical path of every request. In a cloud provider where P99 network=
 latency sat between 10 and 20 milliseconds, those hops dominated the rate =
limit decision time. A check that should have cost microseconds was costing=
 tens of milliseconds.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,5=
5);line-height: 26px;font-size: 16px;text-align: justify">See the diagram b=
elow:</p><div class=3D"captioned-image-container-static" style=3D"font-size=
: 16px;line-height: 26px;margin: 32px auto;"><figure style=3D"width: 100%;m=
argin: 0 auto;"><table class=3D"image-wrapper" width=3D"100%" border=3D"0" =
cellspacing=3D"0" cellpadding=3D"0" data-component-name=3D"Image2ToDOMStati=
c" style=3D"mso-padding-alt: 1em 0 1.6em;"><tbody><tr><td style=3D"text-ali=
gn: center;"></td><td class=3D"content" align=3D"left" width=3D"1456" style=
=3D"text-align: center;"><a class=3D"image-link" target=3D"_blank" href=3D"=
https://substack.com/redirect/8e819219-a82f-4563-868c-51a15ef95f86?j=3DeyJ1=
IjoiNGl3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs" style=3D"posit=
ion: relative;flex-direction: column;align-items: center;padding: 0;width: =
auto;height: auto;border: none;text-decoration: none;display: block;margin:=
 0;"><img class=3D"wide-image" data-attrs=3D"{&quot;src&quot;:&quot;https:/=
/substack-post-media.s3.amazonaws.com/public/images/c5152ea9-bc74-4453-998b=
-b66c39d84b64_2928x1252.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;ful=
lscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:623,&quot;=
width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:117878,&quo=
t;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&qu=
ot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot=
;:false,&quot;internalRedirect&quot;:&quot;https://blog.bytebytego.com/i/19=
6936594?img=3Dhttps%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2=
Fimages%2Fc5152ea9-bc74-4453-998b-b66c39d84b64_2928x1252.png&quot;,&quot;is=
Processing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" al=
t=3D"" width=3D"550" height=3D"235.33653846153845" src=3D"https://substackc=
dn.com/image/fetch/$s_!kYmO!,w_1100,c_limit,f_auto,q_auto:good,fl_progressi=
ve:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimag=
es%2Fc5152ea9-bc74-4453-998b-b66c39d84b64_2928x1252.png" style=3D"border: n=
one !important;vertical-align: middle;display: block;-ms-interpolation-mode=
: bicubic;height: auto;margin-bottom: 0;width: auto !important;max-width: 1=
00% !important;margin: 0 auto;"></a></td><td style=3D"text-align: center;">=
</td></tr></tbody></table></figure></div><p style=3D"margin: 0 0 20px 0;col=
or: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">Th=
e team had already tried to work around this. Envoy can be configured with =
consistent hashing so that requests with the same key land on the same Rate=
limit Service instance, which lets that instance keep a local count. The ap=
proach helped, but it hit three walls.</p><ul style=3D"margin-top: 0;paddin=
g: 0;"><li style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p st=
yle=3D"color: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: =
border-box;padding-left: 4px;font-size: 16px;margin: 0;text-align: justify"=
>Non-Envoy services could not participate in the scheme, which fragmented t=
he rate limit view.</p></li><li style=3D"margin: 8px 0 0 32px;mso-special-f=
ormat: bullet;"><p style=3D"color: rgb(54,55,55);line-height: 26px;margin-b=
ottom: 0;box-sizing: border-box;padding-left: 4px;font-size: 16px;margin: 0=
;text-align: justify">When the service cluster scaled up or restarted, the =
hash assignments churned, which forced regular syncs back to Redis.</p></li=
><li style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p style=3D=
"color: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: border=
-box;padding-left: 4px;font-size: 16px;margin: 0;text-align: justify">Lastl=
y, consistent hashing can be prone to hotspotting, where one very popular k=
ey saturates a single machine while its neighbours sit idle. The only way t=
o push through those hotspots was to over-provision the entire cluster.</p>=
</li></ul><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: =
26px;font-size: 16px;text-align: justify">This is where scaling stops being=
 additive. Adding machines stopped moving the latency numbers, and adding m=
ore caching introduced more inconsistency. The architecture itself was the =
ceiling, and the team had to change it.</p><h2 class=3D"header-anchor-post"=
 style=3D"position: relative;font-family: 'SF Pro Display',-apple-system-he=
adline,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helveti=
ca,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';=
font-weight: bold;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothi=
ng: antialiased;-webkit-appearance: optimizelegibility;-moz-appearance: opt=
imizelegibility;appearance: optimizelegibility;margin: 1em 0 0.625em 0;colo=
r: rgb(54,55,55);line-height: 1.16em;font-size: calc(1.625em * 1);text-alig=
n: justify">Moving the Count In-memory</h2><p style=3D"margin: 0 0 20px 0;c=
olor: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">=
Rate limiting is transient. A per-second count exists only as long as that =
second is current, and the moment it rolls over, the old value becomes irre=
levant.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height:=
 26px;font-size: 16px;text-align: justify">That property opens a door. If a=
 count only needs to live for a second, durable storage is more than the pr=
oblem requires. The count can live in memory on the server that owns it, an=
d losing that server during a restart costs almost nothing.</p><p style=3D"=
margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;t=
ext-align: justify">The challenge is that a single server cannot hold count=
s for every rate limit key across the fleet. The service needs a way to par=
tition keys across servers, and a way for any client to quickly find the se=
rver that owns a given key.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54=
,55,55);line-height: 26px;font-size: 16px;text-align: justify">That is the =
problem Dicer solves at Databricks. For the purposes of this discussion, Di=
cer can be treated as a black box. Dicer is a routing layer that lets a ser=
vice keep state in memory while remaining horizontally scalable and fault-t=
olerant. Clients ask Dicer which server owns a given key, and that server c=
onfirms it is the authoritative owner before handling the request.</p><p st=
yle=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-size:=
 16px;text-align: justify">See the diagram below:</p><div class=3D"captione=
d-image-container-static" style=3D"font-size: 16px;line-height: 26px;margin=
: 32px auto;"><figure style=3D"width: 100%;margin: 0 auto;"><table class=3D=
"image-wrapper" width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0" data-component-name=3D"Image2ToDOMStatic" style=3D"mso-padding-alt: =
1em 0 1.6em;"><tbody><tr><td style=3D"text-align: center;"></td><td class=
=3D"content" align=3D"left" width=3D"1456" style=3D"text-align: center;"><a=
 class=3D"image-link" target=3D"_blank" href=3D"https://substack.com/redire=
ct/a0c3882b-35dd-4ab6-9807-f8927d60702f?j=3DeyJ1IjoiNGl3b2U2In0.sVDxRtmZ85v=
8kfdamY0krRXGMy3p768BWtuZifRB-Zs" style=3D"position: relative;flex-directio=
n: column;align-items: center;padding: 0;width: auto;height: auto;border: n=
one;text-decoration: none;display: block;margin: 0;"><img class=3D"wide-ima=
ge" data-attrs=3D"{&quot;src&quot;:&quot;https://substack-post-media.s3.ama=
zonaws.com/public/images/3511e8e7-397c-49b7-936e-4e6809d0bbe4_2102x1604.png=
&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;im=
ageSize&quot;:null,&quot;height&quot;:1111,&quot;width&quot;:1456,&quot;res=
izeWidth&quot;:null,&quot;bytes&quot;:130442,&quot;alt&quot;:null,&quot;tit=
le&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,=
&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedi=
rect&quot;:&quot;https://blog.bytebytego.com/i/196936594?img=3Dhttps%3A%2F%=
2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3511e8e7-397c-49=
b7-936e-4e6809d0bbe4_2102x1604.png&quot;,&quot;isProcessing&quot;:false,&qu=
ot;align&quot;:null,&quot;offset&quot;:false}" alt=3D"" width=3D"550" heigh=
t=3D"419.6771978021978" src=3D"https://substackcdn.com/image/fetch/$s_!ZqWf=
!,w_1100,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubs=
tack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3511e8e7-397c-49b7-936=
e-4e6809d0bbe4_2102x1604.png" style=3D"border: none !important;vertical-ali=
gn: middle;display: block;-ms-interpolation-mode: bicubic;height: auto;marg=
in-bottom: 0;width: auto !important;max-width: 100% !important;margin: 0 au=
to;"></a></td><td style=3D"text-align: center;"></td></tr></tbody></table><=
/figure></div><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-heig=
ht: 26px;font-size: 16px;text-align: justify">With Dicer in place, the Rate=
limit Service could move every counter in-memory. The network hop to Redis =
disappeared. Server-side tail latency came down sharply, and the team could=
 scale horizontally by adding replicas to Dicer&#8217;s assignment pool. Th=
e single point of failure went away as well, because each replica became th=
e authoritative store for its own slice of keys. Restarts and scale events =
redistributed ownership without any external coordination, and the churn th=
at had forced Redis syncs in the old consistent hashing setup stopped havin=
g an impact.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-he=
ight: 26px;font-size: 16px;text-align: justify">This solved one problem and=
 exposed another.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);li=
ne-height: 26px;font-size: 16px;text-align: justify">The server side was no=
w fast, but the client side still made a synchronous call across the networ=
k for every single request. A rate limit check that had been waiting on Red=
is was now waiting on the Rate Limit Service. The P99 came down, but the sh=
ape of the problem remained. The critical path still had a round trip on it=
=2E</p><h2 class=3D"header-anchor-post"=
 style=3D"position: relative;font-fami=
ly: 'SF Pro Display',-apple-system-headline,system-ui,-apple-system,BlinkMa=
cSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji=
','Segoe UI Emoji','Segoe UI Symbol';font-weight: bold;-webkit-font-smoothi=
ng: antialiased;-moz-osx-font-smoothing: antialiased;-webkit-appearance: op=
timizelegibility;-moz-appearance: optimizelegibility;appearance: optimizele=
gibility;margin: 1em 0 0.625em 0;color: rgb(54,55,55);line-height: 1.16em;f=
ont-size: calc(1.625em * 1);text-align: justify">Optimistic Rate Limiting</=
h2><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;fo=
nt-size: 16px;text-align: justify">This is where the team made its most con=
sequential move.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);lin=
e-height: 26px;font-size: 16px;text-align: justify">Millions of client requ=
ests per second were still translating into millions of synchronous calls t=
o the Ratelimit Service. Even with the server answering in memory, that rep=
resented significant network traffic, significant server capacity, and sign=
ificant client-side waiting. The team asked a harder question.</p><p style=
=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16=
px;text-align: justify">Does every request truly need to wait for a rate li=
mit decision before proceeding?</p><p style=3D"margin: 0 0 20px 0;color: rg=
b(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">They con=
sidered three alternatives:</p><ul style=3D"margin-top: 0;padding: 0;"><li =
style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p style=3D"colo=
r: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: border-box;=
padding-left: 4px;font-size: 16px;margin: 0;text-align: justify">The first =
was prefetching tokens on the client, where the client pulls a block of cap=
acity and answers rate limit checks locally.</p></li><li style=3D"margin: 8=
px 0 0 32px;mso-special-format: bullet;"><p style=3D"color: rgb(54,55,55);l=
ine-height: 26px;margin-bottom: 0;box-sizing: border-box;padding-left: 4px;=
font-size: 16px;margin: 0;text-align: justify">The second was batching requ=
ests on the client and waiting for a response before releasing them.</p></l=
i><li style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p style=
=3D"color: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: bor=
der-box;padding-left: 4px;font-size: 16px;margin: 0;text-align: justify">Th=
e third was sampling, where only a fraction of requests get checked.</p></l=
i></ul><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26p=
x;font-size: 16px;text-align: justify">Each had problems. Prefetching carri=
es messy edge cases during startup, expiry, and token exhaustion. Batching =
adds delay and memory pressure. Sampling works for high-QPS limits but fall=
s apart when the limit itself is small.</p><p style=3D"margin: 0 0 20px 0;c=
olor: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">=
What the team built is called batch-reporting, and it rests on two ideas:</=
p><ul style=3D"margin-top: 0;padding: 0;"><li style=3D"margin: 8px 0 0 32px=
;mso-special-format: bullet;"><p style=3D"color: rgb(54,55,55);line-height:=
 26px;margin-bottom: 0;box-sizing: border-box;padding-left: 4px;font-size: =
16px;margin: 0;text-align: justify">The first is that clients make no remot=
e calls on the rate limit path.</p></li><li style=3D"margin: 8px 0 0 32px;m=
so-special-format: bullet;"><p style=3D"color: rgb(54,55,55);line-height: 2=
6px;margin-bottom: 0;box-sizing: border-box;padding-left: 4px;font-size: 16=
px;margin: 0;text-align: justify">The second is optimistic rate limiting, w=
here the default is to allow the request and reject only when the client al=
ready has a reason to reject from an earlier report.</p></li></ul><div clas=
s=3D"captioned-image-container-static" style=3D"font-size: 16px;line-height=
: 26px;margin: 32px auto;"><figure style=3D"width: 100%;margin: 0 auto;"><t=
able class=3D"image-wrapper" width=3D"100%" border=3D"0" cellspacing=3D"0" =
cellpadding=3D"0" data-component-name=3D"Image2ToDOMStatic" style=3D"mso-pa=
dding-alt: 1em 0 1.6em;"><tbody><tr><td style=3D"text-align: center;"></td>=
<td class=3D"content" align=3D"left" width=3D"1456" style=3D"text-align: ce=
nter;"><a class=3D"image-link" target=3D"_blank" href=3D"https://substack.c=
om/redirect/e18aae4a-0175-4de9-9e0e-9d2dec85fb93?j=3DeyJ1IjoiNGl3b2U2In0.sV=
DxRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs" style=3D"position: relative;flex=
-direction: column;align-items: center;padding: 0;width: auto;height: auto;=
border: none;text-decoration: none;display: block;margin: 0;"><img class=3D=
"wide-image" data-attrs=3D"{&quot;src&quot;:&quot;https://substack-post-med=
ia.s3.amazonaws.com/public/images/4c99a901-9c2c-4ab3-9cf1-99985c074c90_2102=
x1604.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null=
,&quot;imageSize&quot;:null,&quot;height&quot;:1111,&quot;width&quot;:1456,=
&quot;resizeWidth&quot;:null,&quot;bytes&quot;:144889,&quot;alt&quot;:null,=
&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&qu=
ot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;int=
ernalRedirect&quot;:&quot;https://blog.bytebytego.com/i/196936594?img=3Dhtt=
ps%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c99a90=
1-9c2c-4ab3-9cf1-99985c074c90_2102x1604.png&quot;,&quot;isProcessing&quot;:=
false,&quot;align&quot;:null,&quot;offset&quot;:false}" alt=3D"" width=3D"5=
50" height=3D"419.6771978021978" src=3D"https://substackcdn.com/image/fetch=
/$s_!JQZ9!,w_1100,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%=
2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c99a901-9c2c=
-4ab3-9cf1-99985c074c90_2102x1604.png" style=3D"border: none !important;ver=
tical-align: middle;display: block;-ms-interpolation-mode: bicubic;height: =
auto;margin-bottom: 0;width: auto !important;max-width: 100% !important;mar=
gin: 0 auto;"></a></td><td style=3D"text-align: center;"></td></tr></tbody>=
</table></figure></div><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);=
line-height: 26px;font-size: 16px;text-align: justify">The client counts ho=
w many requests it let through and how many it rejected, grouped by rate li=
mit key. Every 100 milliseconds or so, a background thread packages those c=
ounts and reports them to the Ratelimit Service. The server responds with i=
nstructions telling the client which keys should be rejected, until which t=
imestamp, and at what rejection rate.</p><p style=3D"margin: 0 0 20px 0;col=
or: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">Th=
e diagram below shows the three architectures side by side:</p><div class=
=3D"captioned-image-container-static" style=3D"font-size: 16px;line-height:=
 26px;margin: 32px auto;"><figure style=3D"width: 100%;margin: 0 auto;"><ta=
ble class=3D"image-wrapper" width=3D"100%" border=3D"0" cellspacing=3D"0" c=
ellpadding=3D"0" data-component-name=3D"Image2ToDOMStatic" style=3D"mso-pad=
ding-alt: 1em 0 1.6em;"><tbody><tr><td style=3D"text-align: center;"></td><=
td class=3D"content" align=3D"left" width=3D"1456" style=3D"text-align: cen=
ter;"><a class=3D"image-link" target=3D"_blank" href=3D"https://substack.co=
m/redirect/e9a545c5-1f9b-47ab-bd66-18515ea18250?j=3DeyJ1IjoiNGl3b2U2In0.sVD=
xRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs" style=3D"position: relative;flex-=
direction: column;align-items: center;padding: 0;width: auto;height: auto;b=
order: none;text-decoration: none;display: block;margin: 0;"><img class=3D"=
wide-image" data-attrs=3D"{&quot;src&quot;:&quot;https://substack-post-medi=
a.s3.amazonaws.com/public/images/b6fa6d2c-6b90-4019-8b28-e476dbc14e4c_2182x=
1836.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,=
&quot;imageSize&quot;:null,&quot;height&quot;:1225,&quot;width&quot;:1456,&=
quot;resizeWidth&quot;:null,&quot;bytes&quot;:146815,&quot;alt&quot;:null,&=
quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quo=
t;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;inte=
rnalRedirect&quot;:&quot;https://blog.bytebytego.com/i/196936594?img=3Dhttp=
s%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6fa6d2c=
-6b90-4019-8b28-e476dbc14e4c_2182x1836.png&quot;,&quot;isProcessing&quot;:f=
alse,&quot;align&quot;:null,&quot;offset&quot;:false}" alt=3D"" width=3D"55=
0" height=3D"462.74038461538464" src=3D"https://substackcdn.com/image/fetch=
/$s_!q_uQ!,w_1100,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%=
2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6fa6d2c-6b90=
-4019-8b28-e476dbc14e4c_2182x1836.png" style=3D"border: none !important;ver=
tical-align: middle;display: block;-ms-interpolation-mode: bicubic;height: =
auto;margin-bottom: 0;width: auto !important;max-width: 100% !important;mar=
gin: 0 auto;"></a></td><td style=3D"text-align: center;"></td></tr></tbody>=
</table></figure></div><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);=
line-height: 26px;font-size: 16px;text-align: justify">The impact was subst=
antial:</p><ul style=3D"margin-top: 0;padding: 0;"><li style=3D"margin: 8px=
 0 0 32px;mso-special-format: bullet;"><p style=3D"color: rgb(54,55,55);lin=
e-height: 26px;margin-bottom: 0;box-sizing: border-box;padding-left: 4px;fo=
nt-size: 16px;margin: 0;text-align: justify">Tail latency on rate limit cal=
ls fell by roughly a factor of ten, because the calls were effectively free=
 for the client.</p></li><li style=3D"margin: 8px 0 0 32px;mso-special-form=
at: bullet;"><p style=3D"color: rgb(54,55,55);line-height: 26px;margin-bott=
om: 0;box-sizing: border-box;padding-left: 4px;font-size: 16px;margin: 0;te=
xt-align: justify">Spiky inbound traffic turned into constant outbound repo=
rts because the reporting cadence is fixed regardless of how bursty the und=
erlying traffic becomes.</p></li><li style=3D"margin: 8px 0 0 32px;mso-spec=
ial-format: bullet;"><p style=3D"color: rgb(54,55,55);line-height: 26px;mar=
gin-bottom: 0;box-sizing: border-box;padding-left: 4px;font-size: 16px;marg=
in: 0;text-align: justify">Server-side load became predictable for the firs=
t time.</p></li></ul><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);li=
ne-height: 26px;font-size: 16px;text-align: justify">The inversion merits e=
mphasis. The rate limiter used to be asked before each decision. Now it is =
told after. That inversion sits at the core of the redesign, and the tradeo=
ff is explicit. Databricks accepts that some requests over the limit will s=
lip through between reports, and their backends are built to tolerate that =
overshoot.</p><h2 class=3D"header-anchor-post" style=3D"position: relative;=
font-family: 'SF Pro Display',-apple-system-headline,system-ui,-apple-syste=
m,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Co=
lor Emoji','Segoe UI Emoji','Segoe UI Symbol';font-weight: bold;-webkit-fon=
t-smoothing: antialiased;-moz-osx-font-smoothing: antialiased;-webkit-appea=
rance: optimizelegibility;-moz-appearance: optimizelegibility;appearance: o=
ptimizelegibility;margin: 1em 0 0.625em 0;color: rgb(54,55,55);line-height:=
 1.16em;font-size: calc(1.625em * 1);text-align: justify">Bounding The Over=
shoot</h2><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: =
26px;font-size: 16px;text-align: justify">Batch-reporting introduced a prob=
lem of its own.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line=
-height: 26px;font-size: 16px;text-align: justify">Between the moment a cli=
ent starts exceeding a limit and the moment the server tells it to reject, =
traffic can leak through. A hundred milliseconds of overshoot at high QPS a=
mounts to a lot of requests. The team wanted guarantees that kept overshoot=
 within roughly 5 percent of the policy, and reaching that target required =
three-layered fixes.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55)=
;line-height: 26px;font-size: 16px;text-align: justify">The first was a rej=
ection rate returned by the server. The idea is to use the past to predict =
the near future. If the last second&#8217;s traffic exceeded the policy by =
some amount, the formula rejectionRate equals (estimatedQps minus rateLimit=
Policy) divided by estimatedQps tells the client what fraction of upcoming =
requests to drop. This assumes that the next second&#8217;s traffic resembl=
es the last second&#8217;s, which often holds true to help.</p><p style=3D"=
margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;t=
ext-align: justify">The second was a client-side local rate limiter as a de=
fense in depth. When traffic spikes so obviously that the batch cycle has n=
o chance of catching up, the client starts rejecting locally based on its o=
wn counts. This catches the extreme cases immediately rather than waiting f=
or a round trip.</p><div class=3D"captioned-image-container-static" style=
=3D"font-size: 16px;line-height: 26px;margin: 32px auto;"><figure style=3D"=
width: 100%;margin: 0 auto;"><table class=3D"image-wrapper" width=3D"100%" =
border=3D"0" cellspacing=3D"0" cellpadding=3D"0" data-component-name=3D"Ima=
ge2ToDOMStatic" style=3D"mso-padding-alt: 1em 0 1.6em;"><tbody><tr><td styl=
e=3D"text-align: center;"></td><td class=3D"content" align=3D"left" width=
=3D"1456" style=3D"text-align: center;"><a class=3D"image-link" target=3D"_=
blank" href=3D"https://substack.com/redirect/48ebcc43-09bb-43a7-8267-0d1342=
ab8545?j=3DeyJ1IjoiNGl3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs"=
 style=3D"position: relative;flex-direction: column;align-items: center;pad=
ding: 0;width: auto;height: auto;border: none;text-decoration: none;display=
: block;margin: 0;"><img class=3D"wide-image" data-attrs=3D"{&quot;src&quot=
;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9be67dbb=
-4fba-43a5-ad7e-b3eb24a7d94c_2564x1946.png&quot;,&quot;srcNoWatermark&quot;=
:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&q=
uot;:1105,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&q=
uot;:154945,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&q=
uot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&qu=
ot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.byt=
ebytego.com/i/196936594?img=3Dhttps%3A%2F%2Fsubstack-post-media.s3.amazonaw=
s.com%2Fpublic%2Fimages%2F9be67dbb-4fba-43a5-ad7e-b3eb24a7d94c_2564x1946.pn=
g&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&=
quot;:false}" alt=3D"" width=3D"550" height=3D"417.4107142857143" src=3D"ht=
tps://substackcdn.com/image/fetch/$s_!x0wa!,w_1100,c_limit,f_auto,q_auto:go=
od,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%=
2Fpublic%2Fimages%2F9be67dbb-4fba-43a5-ad7e-b3eb24a7d94c_2564x1946.png" sty=
le=3D"border: none !important;vertical-align: middle;display: block;-ms-int=
erpolation-mode: bicubic;height: auto;margin-bottom: 0;width: auto !importa=
nt;max-width: 100% !important;margin: 0 auto;"></a></td><td style=3D"text-a=
lign: center;"></td></tr></tbody></table></figure></div><p style=3D"margin:=
 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;text-ali=
gn: justify">The third was the algorithm itself. Once autosharding lets the=
 service hold counts in memory, the token bucket becomes feasible. The toke=
n bucket has a useful property that a fixed window lacks. Fixed window rese=
ts to zero at the end of every interval, so a customer can blast traffic ri=
ght at a window boundary and technically stay within the policy while sendi=
ng double the intended rate during the crossover. The token bucket continuo=
usly fills and drains, and it can go negative. When a customer sends too ma=
ny requests, the bucket remembers and stays empty until the refill catches =
up. The reset problem disappears. Token bucket also approximates a sliding =
window when configured without extra burst capacity, which produces a stric=
ter shape than a fixed window for most limits.</p><p style=3D"margin: 0 0 2=
0px 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: ju=
stify">This is where the algorithm choice was gated by the storage choice. =
Token bucket needs compare-and-set style logic on every increment, which wa=
s slow in Redis. In-memory, the same operation is close to free. Once the t=
oken bucket was viable, the earlier rejection rate mechanism became unneces=
sary, and the team eventually converted every rate limit in the system to a=
 token bucket.</p><h2 class=3D"header-anchor-post" style=3D"position: relat=
ive;font-family: 'SF Pro Display',-apple-system-headline,system-ui,-apple-s=
ystem,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Appl=
e Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-weight: bold;-webkit=
-font-smoothing: antialiased;-moz-osx-font-smoothing: antialiased;-webkit-a=
ppearance: optimizelegibility;-moz-appearance: optimizelegibility;appearanc=
e: optimizelegibility;margin: 1em 0 0.625em 0;color: rgb(54,55,55);line-hei=
ght: 1.16em;font-size: calc(1.625em * 1);text-align: justify">Three Coupled=
 Decisions</h2><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-hei=
ght: 26px;font-size: 16px;text-align: justify">The Databricks story resolve=
s into three decisions that depend on each other:</p><ul style=3D"margin-to=
p: 0;padding: 0;"><li style=3D"margin: 8px 0 0 32px;mso-special-format: bul=
let;"><p style=3D"color: rgb(54,55,55);line-height: 26px;margin-bottom: 0;b=
ox-sizing: border-box;padding-left: 4px;font-size: 16px;margin: 0;text-alig=
n: justify">The first is the algorithm, which determines how the counter be=
haves at the boundaries of time intervals. Fixed window, sliding window, an=
d token bucket each produce different behaviour in that regard.</p></li><li=
 style=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p style=3D"col=
or: rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: border-box=
;padding-left: 4px;font-size: 16px;margin: 0;text-align: justify">The secon=
d is where the state lives, whether in a shared external store like Redis, =
in an in-memory counter on a single server, or in an in-memory counter shar=
ded across a cluster of servers through some routing layer.</p></li><li sty=
le=3D"margin: 8px 0 0 32px;mso-special-format: bullet;"><p style=3D"color: =
rgb(54,55,55);line-height: 26px;margin-bottom: 0;box-sizing: border-box;pad=
ding-left: 4px;font-size: 16px;margin: 0;text-align: justify">The third is =
the sync model, which can either require every request to wait for a synchr=
onous decision or allow clients to make local decisions and reconcile throu=
gh asynchronous reports.</p></li></ul><p style=3D"margin: 0 0 20px 0;color:=
 rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justify">The o=
ld Databricks architecture sat at one corner of that space, combining a fix=
ed window, shared Redis, and synchronous per-request checks. The new archit=
ecture sits at a different corner, combining token bucket, sharded in-memor=
y storage, and asynchronous batch reports.</p><p style=3D"margin: 0 0 20px =
0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: justif=
y">The dependency chain is worth understanding. Token bucket needs cheap co=
mpare-and-set semantics, which rules out Redis at the QPS Databricks sees, =
which forces in-memory state. In-memory state across many counters forces s=
harding, because one server cannot hold everything. Sharding with authorita=
tive per-key ownership is what enables batch-reporting, because each shard =
can act as the source of truth for its keys without coordinating with peers=
=2E</p><p style=3D"margin: 0 0 20px 0;co=
lor: rgb(54,55,55);line-height: 26px;=
font-size: 16px;text-align: justify">These constraints explain the order of=
 the rollout. Sharded in-memory came first, batch-reporting followed on top=
 of it, and token bucket replaced the algorithm once the state architecture=
 could support it.</p><h2 class=3D"header-anchor-post" style=3D"position: r=
elative;font-family: 'SF Pro Display',-apple-system-headline,system-ui,-app=
le-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'=
Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-weight: bold;-we=
bkit-font-smoothing: antialiased;-moz-osx-font-smoothing: antialiased;-webk=
it-appearance: optimizelegibility;-moz-appearance: optimizelegibility;appea=
rance: optimizelegibility;margin: 1em 0 0.625em 0;color: rgb(54,55,55);line=
-height: 1.16em;font-size: calc(1.625em * 1);text-align: justify">Conclusio=
n</h2><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px=
;font-size: 16px;text-align: justify">The end result is a rate limiter that=
 is faster, more resilient, and more scalable than what came before, at the=
 cost of strict accuracy. That tradeoff is the foundation of the design.</p=
><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font=
-size: 16px;text-align: justify">A system that has to enforce limits exactl=
y, because each request over the limit costs real money or violates a contr=
act, would have to pick a different architecture. Databricks could afford t=
his one because their backends tolerate roughly 5 percent overshoot.</p><p =
style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-height: 26px;font-siz=
e: 16px;text-align: justify">A few smaller details from the rollout are wor=
th noting. The team built a localhost sidecar next to the Envoy ingress to =
host the batch-reporting logic, because Envoy is third-party code they coul=
d not change directly. Before in-memory counting was ready, a Lua script on=
 Redis batched writes together to keep batch-reporting latency manageable d=
uring the migration.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55)=
;line-height: 26px;font-size: 16px;text-align: justify">The rebuild reframe=
s what rate limiting is as a system problem.</p><p style=3D"margin: 0 0 20p=
x 0;color: rgb(54,55,55);line-height: 26px;font-size: 16px;text-align: just=
ify">The algorithm tends to get the attention, but the storage and sync mod=
el determine whether the algorithm can run at scale. Distributed counting i=
s a single design problem with three coupled aspects rather than three inde=
pendent ones.</p><p style=3D"margin: 0 0 20px 0;color: rgb(54,55,55);line-h=
eight: 26px;font-size: 16px;text-align: justify"><strong>References:</stron=
g></p><ul style=3D"margin-top: 0;padding: 0;margin-bottom: 0;"><li style=3D=
"margin: 8px 0 0 32px;mso-special-format: bullet;"><p style=3D"color: rgb(5=
4,55,55);line-height: 26px;margin-bottom: 0;box-sizing: border-box;padding-=
left: 4px;font-size: 16px;margin: 0;text-align: justify"><a href=3D"https:/=
/substack.com/redirect/b90befee-bbce-4d6e-85b9-5921c48697b7?j=3DeyJ1IjoiNGl=
3b2U2In0.sVDxRtmZ85v8kfdamY0krRXGMy3p768BWtuZifRB-Zs" style=3D"color: #7756=
e3;text-decoration: none;">High Performance Ratelimiting at Databricks</a><=
/p></li></ul></div></div><div class=3D"postscript-placeholder" style=3D"mar=
gin: 32px 0 0;width: 100%;box-sizing: border-box;font-size: 16px;line-heigh=
t: 26px;"></div><table class=3D"email-ufi-2-bottom" role=3D"presentation" w=
idth=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" style=3D"bor=
der-top: 1px solid rgb(0,0,0,.1);border-bottom: 1px solid rgb(0,0,0,.1);min=
-width: 100%;"><tbody><tr height=3D"16"><td height=3D"16" style=3D"font-siz=
e:0px;line-height:0;">&nbsp;</td></tr><tr><td><table class=3D"email-ufi-2-r=
ow" role=3D"presentation" width=3D"100%" border=3D"0" cellspacing=3D"0" cel=
lpadding=3D"0" style=3D"border-bottom: 1px solid rgb(0,0,0,.1);"><tbody><tr=
><td width=3D"95%"><table class=3D"email-button-outline-wrapper-full-width"=
 role=3D"presentation" width=3D"auto" border=3D"0" cellspacing=3D"0" cellpa=
dding=3D"0" style=3D"width: 95%;margin: 0 auto;"><tbody><tr><td align=3D"ce=
nter"><a class=3D"email-button-outline full-width" href=3D"https://substack=
=2Ecom/app-link/post?publication_id=3D=
817132&post_id=3D196936594&utm_source=
=3Dsubstack&utm_medium=3Demail&utm_content=3Dshare&utm_campaign=3Demail-sha=
re&action=3Dshare&triggerShare=3Dtrue&isFreemail=3Dtrue&r=3D4iwoe6&token=3D=
eyJ1c2VyX2lkIjoyNzM2MjIzOTgsInBvc3RfaWQiOjE5NjkzNjU5NCwiaWF0IjoxNzc4Njg2ODk=
3LCJleHAiOjE3ODEyNzg4OTcsImlzcyI6InB1Yi04MTcxMzIiLCJzdWIiOiJwb3N0LXJlYWN0aW=
9uIn0.xIMwGAHJcvyJua1BkB3-i7HDfMWxLkSLckG9s2KSyyk" style=3D"font-family: sy=
stem-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,=
sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';display: =
inline-block;font-weight: 500;border: 1px solid rgb(0,0,0,.1);border-radius=
: 9999px;text-transform: uppercase;font-size: 12px;line-height: 12px;paddin=
g: 9px 14px;text-decoration: none;color: rgb(119,119,119);width: 100%;paddi=
ng-left: 0;padding-right: 0;"><img class=3D"icon" src=3D"https://substackcd=
n.com/image/fetch/$s_!rmYa!,w_36,c_scale,f_png,q_auto:good,fl_progressive:s=
teep/https%3A%2F%2Fsubstack.com%2Ficon%2FLucideShare%3Fv%3D4%26height%3D36%=
26fill%3Dnone%26stroke%3D%2523808080%26strokeWidth%3D2" width=3D"18" height=
=3D"18" style=3D"margin-right: 8px;min-width: 18px;min-height: 18px;border:=
 none;vertical-align: middle;max-width: 18px" alt=3D""><span class=3D"email=
-button-text" style=3D"vertical-align: middle;">Share</span></a></td></tr><=
/tbody></table></td></tr><tr height=3D"16"><td height=3D"16" style=3D"font-=
size:0px;line-height:0;">&nbsp;</td></tr></tbody></table></td></tr><tr heig=
ht=3D"16"><td height=3D"16" style=3D"font-size:0px;line-height:0;">&nbsp;</=
td></tr><tr><td><table role=3D"presentation" width=3D"100%" border=3D"0" ce=
llspacing=3D"0" cellpadding=3D"0"><tbody><tr><td><table role=3D"presentatio=
n" width=3D"auto" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" style=3D=
"margin:0 auto;"><tbody><tr><td style=3D"vertical-align:middle;"><table rol=
e=3D"presentation" width=3D"auto" border=3D"0" cellspacing=3D"0" cellpaddin=
g=3D"0"><tbody><tr><td align=3D"center"><a class=3D"email-button-outline" h=
ref=3D"https://substack.com/app-link/post?publication_id=3D817132&post_id=
=3D196936594&utm_source=3Dsubstack&isFreemail=3Dtrue&submitLike=3Dtrue&toke=
n=3DeyJ1c2VyX2lkIjoyNzM2MjIzOTgsInBvc3RfaWQiOjE5NjkzNjU5NCwicmVhY3Rpb24iOiL=
inaQiLCJpYXQiOjE3Nzg2ODY4OTcsImV4cCI6MTc4MTI3ODg5NywiaXNzIjoicHViLTgxNzEzMi=
IsInN1YiI6InJlYWN0aW9uIn0.Y6nz6uhCstGeoDKA_uvtsBnleMH5mOIZi6-roFmL3MM&utm_m=
edium=3Demail&utm_campaign=3Demail-reaction&r=3D4iwoe6" style=3D"font-famil=
y: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,A=
rial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';disp=
lay: inline-block;font-weight: 500;border: 1px solid rgb(0,0,0,.1);border-r=
adius: 9999px;text-transform: uppercase;font-size: 12px;line-height: 12px;p=
adding: 9px 14px;text-decoration: none;color: rgb(119,119,119);"><img class=
=3D"icon" src=3D"https://substackcdn.com/image/fetch/$s_!PeVs!,w_36,c_scale=
,f_png,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Ficon%2=
FLucideHeart%3Fv%3D4%26height%3D36%26fill%3Dnone%26stroke%3D%2523808080%26s=
trokeWidth%3D2" width=3D"18" height=3D"18" style=3D"margin-right: 8px;min-w=
idth: 18px;min-height: 18px;border: none;vertical-align: middle;max-width: =
18px" alt=3D""><span class=3D"email-button-text" style=3D"vertical-align: m=
iddle;">Like</span></a></td></tr></tbody></table></td><td width=3D"8" style=
=3D"min-width:8px;"></td><td style=3D"vertical-align:middle;"><table role=
=3D"presentation" width=3D"auto" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0"><tbody><tr><td align=3D"center"><a class=3D"email-button-outline" hr=
ef=3D"https://substack.com/app-link/post?publication_id=3D817132&post_id=3D=
196936594&utm_source=3Dsubstack&utm_medium=3Demail&isFreemail=3Dtrue&commen=
ts=3Dtrue&token=3DeyJ1c2VyX2lkIjoyNzM2MjIzOTgsInBvc3RfaWQiOjE5NjkzNjU5NCwia=
WF0IjoxNzc4Njg2ODk3LCJleHAiOjE3ODEyNzg4OTcsImlzcyI6InB1Yi04MTcxMzIiLCJzdWIi=
OiJwb3N0LXJlYWN0aW9uIn0.xIMwGAHJcvyJua1BkB3-i7HDfMWxLkSLckG9s2KSyyk&r=3D4iw=
oe6&utm_campaign=3Demail-half-magic-comments&action=3Dpost-comment&utm_sour=
ce=3Dsubstack&utm_medium=3Demail" style=3D"font-family: system-ui,-apple-sy=
stem,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple=
 Color Emoji','Segoe UI Emoji','Segoe UI Symbol';display: inline-block;font=
-weight: 500;border: 1px solid rgb(0,0,0,.1);border-radius: 9999px;text-tra=
nsform: uppercase;font-size: 12px;line-height: 12px;padding: 9px 14px;text-=
decoration: none;color: rgb(119,119,119);"><img class=3D"icon" src=3D"https=
://substackcdn.com/image/fetch/$s_!x1tS!,w_36,c_scale,f_png,q_auto:good,fl_=
progressive:steep/https%3A%2F%2Fsubstack.com%2Ficon%2FLucideComments%3Fv%3D=
4%26height%3D36%26fill%3Dnone%26stroke%3D%2523808080%26strokeWidth%3D2" wid=
th=3D"18" height=3D"18" style=3D"margin-right: 8px;min-width: 18px;min-heig=
ht: 18px;border: none;vertical-align: middle;max-width: 18px" alt=3D""><spa=
n class=3D"email-button-text" style=3D"vertical-align: middle;">Comment</sp=
an></a></td></tr></tbody></table></td><td width=3D"8" style=3D"min-width:8p=
x;"></td><td style=3D"vertical-align:middle;"><table role=3D"presentation" =
width=3D"auto" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"><tbody><tr>=
<td align=3D"center"><a class=3D"email-button-outline" href=3D"https://subs=
tack.com/redirect/2/eyJlIjoiaHR0cHM6Ly9vcGVuLnN1YnN0YWNrLmNvbS9wdWIvYnl0ZWJ=
5dGVnby9wL2hpZ2gtcGVyZm9ybWFuY2UtcmF0ZS1saW1pdGluZy1hdD91dG1fc291cmNlPXN1Yn=
N0YWNrJnV0bV9tZWRpdW09ZW1haWwmdXRtX2NhbXBhaWduPWVtYWlsLXJlc3RhY2stY29tbWVud=
CZhY3Rpb249cmVzdGFjay1jb21tZW50JnI9NGl3b2U2JnRva2VuPWV5SjFjMlZ5WDJsa0lqb3lO=
ek0yTWpJek9UZ3NJbkJ2YzNSZmFXUWlPakU1Tmprek5qVTVOQ3dpYVdGMElqb3hOemM0TmpnMk9=
EazNMQ0psZUhBaU9qRTNPREV5TnpnNE9UY3NJbWx6Y3lJNkluQjFZaTA0TVRjeE16SWlMQ0p6ZF=
dJaU9pSndiM04wTFhKbFlXTjBhVzl1SW4wLnhJTXdHQUhKY3Z5SnVhMUJrQjMtaTdIRGZNV3hMa=
1NMY2tHOXMyS1N5eWsiLCJwIjoxOTY5MzY1OTQsInMiOjgxNzEzMiwiZiI6dHJ1ZSwidSI6Mjcz=
NjIyMzk4LCJpYXQiOjE3Nzg2ODY4OTcsImV4cCI6MjA5NDI2Mjg5NywiaXNzIjoicHViLTAiLCJ=
zdWIiOiJsaW5rLXJlZGlyZWN0In0.GFZsI0dgsXQZRjelQFAYfhLZj1giwuSxqqsS_VZR0NM?&u=
tm_source=3Dsubstack&utm_medium=3Demail" style=3D"font-family: system-ui,-a=
pple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif=
,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';display: inline-blo=
ck;font-weight: 500;border: 1px solid rgb(0,0,0,.1);border-radius: 9999px;t=
ext-transform: uppercase;font-size: 12px;line-height: 12px;padding: 9px 14p=
x;text-decoration: none;color: rgb(119,119,119);"><img class=3D"icon" src=
=3D"https://substackcdn.com/image/fetch/$s_!ubXF!,w_36,c_scale,f_png,q_auto=
:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Ficon%2Fnotes__NoteR=
estackIcon%3Fv%3D4%26height%3D36%26fill%3Dnone%26stroke%3D%2523808080%26str=
okeWidth%3D2%26strokeLinecap%3Dround%26strokeLinejoin%3Dround" width=3D"18"=
 height=3D"18" alt=3D"" style=3D"margin-right: 8px;min-width: 18px;min-heig=
ht: 18px;max-width: 550px;border: none !important;vertical-align: middle;">=
<span class=3D"email-button-text" style=3D"vertical-align: middle;">Restack=
</span></a></td></tr></tbody></table></td></tr></tbody></table></td><td ali=
gn=3D"right"><table role=3D"presentation" width=3D"auto" border=3D"0" cells=
pacing=3D"0" cellpadding=3D"0"><tbody><tr></tr></tbody></table></td></tr></=
tbody></table></td></tr><tr height=3D"16"><td height=3D"16" style=3D"font-s=
ize:0px;line-height:0;">&nbsp;</td></tr></tbody></table><div class=3D"foote=
r footer-ZM59BM" style=3D"color: rgb(119,119,119);text-align: center;font-s=
ize: 16px;line-height: 26px;padding: 24px0;"><div style=3D"font-size: 16px;=
line-height: 26px;padding-bottom: 24px"><p class=3D"pencraft pc-reset color=
-secondary-ls1g8s size-12-mmZ61m reset-IxiVJZ small meta-B2bqa5" style=3D"l=
ist-style: none;font-family: system-ui,-apple-system,BlinkMacSystemFont,'Se=
goe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emo=
ji','Segoe UI Symbol';padding-bottom: 0;font-size: 12px;line-height: 16px;m=
argin: 0;color: rgb(119,119,119);text-decoration: unset;">&#169; 2026 <span=
>ByteByteGo</span><br>548 Market Street PMB 72296, San Francisco, CA 94104 =
<br><a href=3D"https://substack.com/redirect/2/eyJlIjoiaHR0cHM6Ly9ibG9nLmJ5=
dGVieXRlZ28uY29tL2FjdGlvbi9kaXNhYmxlX2VtYWlsP3Rva2VuPWV5SjFjMlZ5WDJsa0lqb3l=
Oek0yTWpJek9UZ3NJbkJ2YzNSZmFXUWlPakU1Tmprek5qVTVOQ3dpYVdGMElqb3hOemM0TmpnMk=
9EazNMQ0psZUhBaU9qRTRNVEF5TWpJNE9UY3NJbWx6Y3lJNkluQjFZaTA0TVRjeE16SWlMQ0p6Z=
FdJaU9pSmthWE5oWW14bFgyVnRZV2xzSW4wLmQySDBOenh3b1JsU3pLX3dzZHBCVFkzS3dNNkdY=
c0tZdEU2TFBtd28tS3MiLCJwIjoxOTY5MzY1OTQsInMiOjgxNzEzMiwiZiI6dHJ1ZSwidSI6Mjc=
zNjIyMzk4LCJpYXQiOjE3Nzg2ODY4OTcsImV4cCI6MjA5NDI2Mjg5NywiaXNzIjoicHViLTAiLC=
JzdWIiOiJsaW5rLXJlZGlyZWN0In0.fOLHTBQexV2x2a83iBNke3lzIJMcoNb4tZd33PcWWfE?"=
 style=3D"color: #7756e3;text-decoration: none;"><span style=3D"color: rgb(=
119,119,119);text-decoration: underline;">Unsubscribe</span></a></p></div><=
p class=3D"footerSection-EHR0jG small powered-by-substack" style=3D"padding=
: 0 24px;font-size: 12px;line-height: 20px;margin: 0;color: rgb(119,119,119=
);font-family: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto=
,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI =
Symbol';padding-bottom: 0;margin-top: 0;"><a href=3D"https://substack.com/r=
edirect/2/eyJlIjoiaHR0cHM6Ly9zdWJzdGFjay5jb20vc2lnbnVwP3V0bV9zb3VyY2U9c3Vic=
3RhY2smdXRtX21lZGl1bT1lbWFpbCZ1dG1fY29udGVudD1mb290ZXImdXRtX2NhbXBhaWduPWF1=
dG9maWxsZWQtZm9vdGVyJmZyZWVTaWdudXBFbWFpbD10anBodWhzQGdtYWlsLmNvbSZyPTRpd29=
lNiIsInAiOjE5NjkzNjU5NCwicyI6ODE3MTMyLCJmIjp0cnVlLCJ1IjoyNzM2MjIzOTgsImlhdC=
I6MTc3ODY4Njg5NywiZXhwIjoyMDk0MjYyODk3LCJpc3MiOiJwdWItMCIsInN1YiI6Imxpbmstc=
mVkaXJlY3QifQ.XmqjlJQVYp5n7oQCgll0fVdLfYL874MGMe9EeRyKGSM?" style=3D"color:=
 #7756e3;text-decoration: none;display: inline-block;margin: 0 4px;"><img s=
rc=3D"https://substackcdn.com/image/fetch/$s_!LkrL!,w_270,c_limit,f_auto,q_=
auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Femail%2Fp=
ublish-button%402x.png" srcset=3D"https://substackcdn.com/image/fetch/$s_!w=
gfj!,w_135,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsu=
bstack.com%2Fimg%2Femail%2Fpublish-button.png, https://substackcdn.com/imag=
e/fetch/$s_!LkrL!,w_270,c_limit,f_auto,q_auto:good,fl_progressive:steep/htt=
ps%3A%2F%2Fsubstack.com%2Fimg%2Femail%2Fpublish-button%402x.png 2x, https:/=
/substackcdn.com/image/fetch/$s_!KjtY!,w_405,c_limit,f_auto,q_auto:good,fl_=
progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Femail%2Fpublish-button=
%403x.png 3x" width=3D"135" alt=3D"Start writing" height=3D"40" style=3D"ma=
x-width: 550px;border: none !important;vertical-align: middle;"></a></p></d=
iv></div></td><td></td></tr></tbody></table><img src=3D"https://eotrx.subst=
ackcdn.com/o/a180bee98fd884e4/p.gif?token=3DeyJtIjoiPDIwMjYwNTEzMTUzMDM1LjM=
uZjEzYzdiYmY1OWJkOGY1Y0BtZy1kMC5zdWJzdGFjay5jb20-IiwidSI6MjczNjIyMzk4LCJyIj=
oidGpwaHVoc0BnbWFpbC5jb20iLCJkIjoibWctZDAuc3Vic3RhY2suY29tIiwicCI6MTk2OTM2N=
Tk0LCJ0IjoibmV3c2xldHRlciIsImEiOiJldmVyeW9uZSIsInMiOjgxNzEzMiwiYyI6InBvc3Qi=
LCJmIjp0cnVlLCJwb3NpdGlvbiI6ImJvdHRvbSIsImlhdCI6MTc3ODY4Njg5NywiZXhwIjoxNzg=
xMjc4ODk3LCJpc3MiOiJwdWItMCIsInN1YiI6ImVvIn0.OuJoibhbt_ZKIflcvRwODwWJD8_zPP=
EqsKJ2x17O6q8" alt=3D"" width=3D"1" height=3D"1" border=3D"0" style=3D"heig=
ht:1px !important;width:1px !important;border-width:0 !important;margin-top=
:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-l=
eft:0 !important;padding-top:0 !important;padding-bottom:0 !important;paddi=
ng-right:0 !important;padding-left:0 !important;"/><img width=3D"1" height=
=3D"1" alt=3D"" src=3D"https://email.mg-d0.substack.com/o/eJxMkE2OhCAQRk_T7=
MYIyN-Csxh-SmVGwUDRE28_sbsXs6jNq-Tl5QsOYS31smdpSKKV3C0iErBUKS211EYROFza5xUy=
VIcQZ4f_vpRqstkgFWduioIrI5jxPEzSKG_0IrTTXJBk2cjkKCingo9cDHxYKA_K-0UYH_UiwmM=
aj_UrjkPrvqELP0MoB0ltXiq8EizWDuQOnV2PCXIAC0-oV8kfnKKlRhouhZneBK8TbIbftgMiVH=
J2P4dyHD0nvGbIzu8QP-Lu9xQcppJvkaaKckaqxe9z61t7TON6V7yqWvexHC5l6y-E-9ZC8D1ib=
1BvAVNcMsaNJk_L_gIAAP__mqN3TA"></body></html>
--666e983acfd920f457cd93c2dc0675c6c14992e5b9e30eb00ffa296535ba--
