java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Implement Microservices Load Shedding pattern

Open iluwatar opened this issue 10 months ago • 3 comments

Description

The Microservices Load Shedding pattern ensures a system gracefully handles overload situations by rejecting or shedding excess requests once it hits a predefined capacity limit. By proactively managing incoming load, the system preserves resources for critical requests and avoids a complete meltdown under high or unexpected traffic spikes.

Key Elements

  • Dynamic Throttling or Request Limiting: Automatically rejecting new requests when system capacity is reached.
  • Fail-Fast Mechanisms: Quickly responding with error codes or fallback responses, rather than letting requests queue indefinitely.
  • Monitoring & Capacity Management: Observing real-time traffic and system metrics to adjust thresholds.

References

  1. Microservices.io – Load Shedding Pattern
  2. Release It! by Michael T. Nygard
  3. Java Design Patterns – Contribution Guidelines

Acceptance Criteria

  • [ ] Create a new module or package named microservices-load-shedding (or similar).
  • [ ] Demonstrate how to detect and shed excess load (e.g., using a request queue with a maximum capacity).
  • [ ] Provide logic for fast failure or fallback responses when capacity is exceeded.
  • [ ] Include a README (or .md file) explaining the pattern, its benefits, and sample code.
  • [ ] Verify the implementation with tests simulating both normal load and overload scenarios.
  • [ ] Ensure conformance with repository standards and that all CI checks pass.

iluwatar avatar Mar 30 '25 09:03 iluwatar

Hello @iluwatar , i would like to attempt this issue, it will be a good opportunity to learn as well.

naman-sriv avatar Apr 07 '25 07:04 naman-sriv

This issue is stale because it has been open 60 days with no activity.

github-actions[bot] avatar Jun 07 '25 02:06 github-actions[bot]

@iluwatar Is this issue resolved because I dont see any activity here. If not then I would like to contribute in this issue. Can you assign it to me?

Vansh1228 avatar Oct 07 '25 05:10 Vansh1228