Book Image

Implementing Cloud Design Patterns for AWS

Book Image

Implementing Cloud Design Patterns for AWS

Overview of this book

Table of Contents (18 chapters)
Implementing Cloud Design Patterns for AWS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Priority queue pattern


The previous queuing chain pattern is a great example of how to begin working with independent systems in a complex setup. Using the same example, we can show how to give priority to queues using third-party tools. Imagine a system where the workers might have multiple queues to work from. You can scale the worker systems independently by dedicating some instances to one queue and some instances to the other.

However, the problem in doing so is that you will have duplicate logic across both sets of instances. Using the previous example, all workers would still solve the problem with the same fibonacci algorithm but we will have to manage two sets of instances. Instead, the better route would be to assign a weight to the queues and have a single pool of instances assigned to all the queues. This would mean that you must only manage a single set of resources and let the instances determine how to grab from the queues.

This logic of assigning weights is custom but luckily...