レート制限ポリシーは、バックエンド システムを保護するために API 実装に適用されます。最近、需要が急増し、API 実装への一部の API クライアント POST リクエストがポリシー関連のエラーで拒否され、API クライアントに遅延や複雑化が生じています。 バックエンド システムを保護しながら、API クライアントに返されるエラーの頻度を減らすには、API 実装に適用される API ポリシーをどのように変更すればよいでしょうか。
正解:D
When managing high traffic to an API, especially with POST requests, it is crucial to ensure the API's policies both protect the back-end systems and provide a smooth client experience. Here's the approach to reducing errors: * Rate Limiting Policy: This policy enforces a limit on the number of requests within a defined time period. However, rate limiting alone may cause clients to hit limits during demand surges, leading to errors. * Adding an SLA-based Spike Control Policy: * Spike Control is designed to handle sudden increases in traffic by smoothing out bursts of requests, which is particularly useful during high-demand periods. * By configuring SLA-based Spike Control, you can define thresholds for specific client tiers. For instance, premium clients might have higher limits or more flexibility in traffic bursts than standard clients. * Why Option D is Correct: * Keeping the Rate Limiting policy continues to provide baseline protection for the back-end. * Adding the SLA-based Spike Control policy allows for differentiated control, where requests are queued or delayed during bursts rather than outright rejected. This approach significantly reduces error responses to clients while still controlling overall traffic. * Explanation of Incorrect Options: * Option A (adding Client ID Enforcement) would not reduce errors related to traffic surges. * Option B (HTTP Caching) is not applicable as caching is generally ineffective for non- idempotent requests like POST. * Option C (only Spike Control without Rate Limiting) may leave the back-end system vulnerable to sustained high traffic levels, reducing protection. ReferencesFor more information on configuring Rate Limiting and SLA-based Spike Control policies, refer to MuleSoft documentation on API Policies and Rate Limiting.