.github
abstract-document
abstract-factory
acyclic-visitor
adapter
aggregator-microservices
ambassador
api-gateway
arrange-act-assert
async-method-invocation
balking
bridge
builder
business-delegate
bytecode
caching
callback
chain
circuit-breaker
collection-pipeline
combinator
command
commander
composite
converter
cqrs
dao
data-bus
data-locality
data-mapper
data-transfer-object
decorator
delegation
dependency-injection
dirty-flag
double-buffer
double-checked-locking
double-dispatch
eip-aggregator
eip-message-channel
eip-publish-subscribe
eip-splitter
eip-wire-tap
etc
event-aggregator
event-asynchronous
event-driven-architecture
event-queue
event-sourcing
execute-around
extension-objects
facade
factory-kit
factory-method
feature-toggle
fluentinterface
flux
flyweight
front-controller
game-loop
guarded-suspension
half-sync-half-async
hexagonal
intercepting-filter
interpreter
iterator
layers
lazy-loading
leader-election
leader-followers
marker
master-worker-pattern
mediator
memento
model-view-controller
model-view-presenter
module
monad
monostate
multiton
mute-idiom
mutex
naked-objects
null-object
object-mother
object-pool
observer
page-object
partial-response
pipeline
poison-pill
priority-queue
private-class-data
producer-consumer
promise
property
prototype
proxy
queue-load-leveling
etc
src
README.md
pom.xml
reactor
reader-writer-lock
repository
resource-acquisition-is-initialization
retry
role-object
saga
semaphore
servant
serverless
service-layer
service-locator
sharding
singleton
spatial-partition
specification
state
step-builder
strangler
strategy
subclass-sandbox
template-method
thread-pool
throttling
tls
tolerant-reader
trampoline
twin
typeobjectpattern
unit-of-work
update-method
value-object
visitor
zh
.all-contributorsrc
.gitignore
CONTRIBUTING.MD
LICENSE.md
PULL_REQUEST_TEMPLATE.md
README.md
checkstyle-suppressions.xml
license-plugin-header-style.xml
pom.xml
37 lines
1.4 KiB
Markdown
37 lines
1.4 KiB
Markdown
---
|
|
layout: pattern
|
|
title: Queue based load leveling
|
|
folder: queue-load-leveling
|
|
permalink: /patterns/queue-load-leveling/
|
|
categories: Concurrency
|
|
tags:
|
|
- Decoupling
|
|
- Performance
|
|
- Cloud distributed
|
|
---
|
|
|
|
## 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.
|
|
|
|
## Class diagram
|
|

|
|
|
|
## 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
|
|
* [Queue-Based Load Leveling Pattern](http://java-design-patterns.com/blog/queue-load-leveling/)
|
|
|
|
## 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
|
|
|
|
* [Queue-Based Load Leveling pattern](https://docs.microsoft.com/en-us/azure/architecture/patterns/queue-based-load-leveling)
|