Skip to content

Instantly share code, notes, and snippets.

@bearzk
Last active February 12, 2019 13:13
Show Gist options
  • Save bearzk/396f76f196ef9e67ed3b2e9bda145338 to your computer and use it in GitHub Desktop.
Save bearzk/396f76f196ef9e67ed3b2e9bda145338 to your computer and use it in GitHub Desktop.
[Queue-Based Load Leveling pattern] #cloud #designpattern

Queue-Based Load Leveling pattern

Why and When?

Sometimes a part of our application just can not run that fast, it could be for example, avatar processing, email sending, and in these case we don't usually need a response/confirmation that the action is finished, we can push these tasks into queue and handle them asynchronously to take the load off the system.

How?

  • push slow tasks into queue
  • consume queue with worker
  • many workers can run at the same time, so tasks are finished faster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment