Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate Limiting pattern #2973

Open
iluwatar opened this issue Jun 1, 2024 · 0 comments
Open

Rate Limiting pattern #2973

iluwatar opened this issue Jun 1, 2024 · 0 comments

Comments

@iluwatar
Copy link
Owner

iluwatar commented Jun 1, 2024

Description:
The Rate Limiting design pattern is crucial in a microservices architecture to prevent abuse and ensure fair usage of resources. This pattern restricts the number of requests a service can handle within a specified timeframe, thereby enhancing reliability and performance by preventing overloading. This implementation will involve creating a mechanism to count and limit the number of incoming requests to a service, and take appropriate actions when the limit is exceeded.

Main Elements of the Pattern:

  1. Rate Limiter: A component responsible for tracking the number of requests and enforcing the rate limit.
  2. Policy Configuration: Defines the rate limit rules, such as the number of requests allowed per time unit and what actions to take when the limit is exceeded.
  3. Client Identification: Mechanism to identify clients (e.g., IP address, API key) to apply rate limits individually.
  4. Throttling: Delaying or rejecting requests when the rate limit is exceeded.
  5. Monitoring and Logging: Tools to monitor and log rate-limiting activities for analysis and tuning.

References:

  1. Rate Limiting Pattern - Microservices.io
  2. API Rate Limiting - Amazon API Gateway
  3. Rate Limiting Strategies and Techniques
  4. Project Contribution Guidelines

Acceptance Criteria:

  1. Implement a rate limiter that can be configured with different policies.
  2. Provide configuration options to define rate limit rules (e.g., requests per second).
  3. Ensure the rate limiter can identify different clients and apply rate limits accordingly.
  4. Implement mechanisms to throttle or reject requests exceeding the limit.
  5. Include logging to capture rate-limiting events for monitoring purposes.
  6. Provide comprehensive documentation and examples demonstrating how to use the rate limiter.
  7. Write unit and integration tests to ensure the rate limiter works as expected under various scenarios.
mcdodik20008 pushed a commit to mcdodik20008/java-design-patterns that referenced this issue Jul 4, 2024
mcdodik20008 pushed a commit to mcdodik20008/java-design-patterns that referenced this issue Jul 4, 2024
Заготовка архитектуры
mcdodik20008 pushed a commit to mcdodik20008/java-design-patterns that referenced this issue Jul 5, 2024
java: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'
mcdodik20008 pushed a commit to mcdodik20008/java-design-patterns that referenced this issue Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant