Skip to main content
Architecture9 min read

レート制限:手遅れになるまで誰も考えない機能

APIは毎秒10リクエストでは完璧に動作します。10,000リクエストではダウンします。正当なユーザーを煩わせずに保護するレート制限の実装方法をご紹介します。

Part ofCloud & Infrastructure->
By Jason TeixeiraDecember 15, 2025
SecurityAPIRate LimitingArchitectureAWS
Share:
On this page

誰もスプリントボードに「レート制限を実装する」とは書きません。それはユーザーストーリーではありません。メトリクスを動かすものでもありません。プロダクトが求めることもありません。

そしてある日、誰かが30秒でAPIに5万リクエストを送るスクリプトを仕込み、あなたのデータベースはダウンします。あるいはもっと悪いケースでは、たった一人のユーザーの暴走スクリプトが、一晩でAWS Lambdaの呼び出し料金として800ドルを費やします。

この両方を私は経験しました。今ではレート制限は私のスターターテンプレートに組み込まれています。

三つのレイヤー

私はレート制限を三つのレイヤーで実装しています。それぞれが異なる悪用パターンを捕捉するからです:

レイヤー1:エッジ(CloudFront / Vercel)

\\

Reader route

article -> proof -> offer

ReadClusterProofScope

cluster

Cloud & Infrastructure

intent

Architecture

route

next step

What to do with this

Turn the note into a build path.

If this topic maps to a real business problem, keep reading the cluster, study the academy path, or route the work into a scoped engagement.

Jason Teixeira
Written by
Jason Teixeira
Founder, Sage Ideas Studio · Principal Engineer
livebuild 5d6c8652026-08-05 06:00Z
// solo studio// no analytics resold// every commit human-reviewed