Chapter 15. Decoupling your infrastructure: Elastic Load Balancing and Simple Queue Service
This chapter covers
- The reasons for decoupling a system
- Synchronous decoupling with load balancers to distribute requests
- Hiding your backend from users and message producers
- Asynchronous decoupling with message queues to buffer message peaks
Imagine that you want some advice from us about using AWS, and therefore we plan to meet in a cafe. To make this meeting successful, we must
- Be available at the same time
- Be at the same place
- Find each other at the cafe
The problem with our meeting is that it’s tightly coupled to a location. We live in Germany; you probably don’t. We can solve that issue by decoupling our meeting from the location. So we change plans and schedule a Google Hangout session. Now we must:
- Be available at the same time
- Find each other in Google Hangouts
Google Hangouts (and other video/voice chat services) does synchronous decoupling. It removes the need to be at the same place, while still requiring us to meet at the same time.
We can even decouple from time by using email. Now we must:
- Find each other via email
Email does asynchronous decoupling. You can send an email when the recipient is asleep, and they can respond later when they’re awake.