java-design-patterns/queue-load-leveling
Anurag Agarwal 6ef840f3cf Resolves checkstyle errors for naked-objects null-object object-mother object-pool observer queue-load-leveling (#1082)
* Reduces checkstyle errors in naked-objects

* Reduces checkstyle errors in null-object

* Reduces checkstyle errors in object-mother

* Reduces checkstyle errors in object-pool

* Reduces checkstyle errors in observer

* Reduces checkstyle errors in queue-load-leveling
2019-11-12 21:26:15 +02:00
..
2017-11-28 20:55:52 +02:00
2019-10-12 20:05:54 +03:00
2017-11-28 21:28:53 +02:00

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Queue based load leveling queue-load-leveling /patterns/queue-load-leveling/ Other
Java
Difficulty-Intermediate
Performance

Intent

Use a queue that acts as a buffer between a task and a service that it invokes in order to smooth intermittent heavy loads that may otherwise cause the service to fail or the task to time out. This pattern can help to minimize the impact of peaks in demand on availability and responsiveness for both the task and the service.

alt text

Applicability

  • This pattern is ideally suited to any type of application that uses services that may be subject to overloading.
  • This pattern might not be suitable if the application expects a response from the service with minimal latency.

Tutorials

Real world example

  • A Microsoft Azure web role stores data by using a separate storage service. If a large number of instances of the web role run concurrently, it is possible that the storage service could be overwhelmed and be unable to respond to requests quickly enough to prevent these requests from timing out or failing.

Credits