サービス間の安全な内部通信を実現する新機能
本文の状態
日本語全文を表示中
詳細モードで約2分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Vercel Blog
Vercel は「Service Bindings」機能を導入し、同一デプロイ内の別サービス間での安全な通信を可能にした。これにより、ユーザーコードは通常通り URL を呼び出すだけで、Vercel が裏側でルーティングや認証、TLS 処理を自動管理する。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Service Bindings を使用すると、同じデプロイメント内にある別の Vercel サービスを安全に呼び出すことが容易になります。
あるサービスが他のサービスのバインディング(binding)を宣言すると、Vercel は自動的に設定された環境変数を注入します。つまり、ユーザーコードは通常通りその URL を取得できますが、内部の書き換え、ルーティング、認証、TLS 管理は Vercel が裏側で処理します。
これにより、Next.js フロントエンドが FastAPI バックエンドを呼び出すような、Vercel 上のマルチサービスアプリケーションが可能になります。同時に、サービスの分離性を維持し、ルーティング設定の簡素化も実現できます:
上記の例では、my_frontend は BACKEND_INTERNAL_URL に対して fetch() リクエストを送信することで、my_backend サービスに到達できるようになります。
FastAPI 側では、my_backend が通常のルート(route)を公開しています:
仕組みの内部
この URL はパブリックアドレスではなく、Vercel の内部を指しています。コードがこれを取得すると、リクエストは Vercel の内部ネットワークを経由して、デプロイメントへの他のすべてのリクエストと同じルーティング層へ到達し、そこからターゲットサービスへ転送されます。パブリックルートテーブルには決して到達せず、Vercel が TLS 信頼関係を自動的に設定するため、証明書設定なしで通常の HTTPS fetch が機能します。
サービスは、rewrite ルートによる公開またはバインディングによる非公開のいずれかで明示的に公開されない限り、到達不可能です。
観測性(Observability)
サービス間呼び出しも観測性ツールに表示されるため、どのバインドされたサービスが呼び出され、リクエストにどれほどの時間がかかったかを確認できます:
料金プラン
サービス間呼び出しは、Service Requests および Fast Origin Transfer として課金されます。CDN Requests や Fast Data Transfer としての課金は行われません。現在の料率については、サービスの価格および制限に関するページをご覧ください。
詳細はこちら
バインディングの宣言方法や完全なリファレンスを確認するには、バインディングドキュメントをお読みください。
続きを読む
原文を表示
Service Bindings make it easy for one Vercel service to securely call another within the same deployment.
When a service declares a binding for another service, Vercel automatically injects the configured environment variable. That means user code can fetch that URL normally, while Vercel handles the internal rewrite, routing, authentication, and TLS behind the scenes.
This enables multi-service applications on Vercel, like a Next.js frontend calling a FastAPI backend, while preserving service isolation and keeping routing configuration simple:
In the example above, my_frontend will be able to reach the my_backend service by making a fetch() request to BACKEND_INTERNAL_URL.
On the FastAPI side, my_backend exposes a normal route:
Under the hood
That URL points inside Vercel, not at a public address. When your code fetches it, the request travels over Vercel's internal network to the same routing layer that handles every other request to your deployment, which sends it to the target service. It never hits the public route table, and Vercel sets up the TLS trust for you, so a plain HTTPS fetch works with no certificate config.
A service is only reachable if you expose it, either publicly with a rewrite route or privately with a binding.
Observability
Service-to-service calls also appear in observability, so you can see which bound service was called and how long the request took:
Pricing
Service-to-service calls are billed as Service Requests and Fast Origin Transfer. They are not billed as CDN Requests or Fast Data Transfer. See services pricing and limits for current rates.
Learn more
Read the bindings documentation to declare bindings and see the full reference.
Read more
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み