With 20+ years in the SaaS world as a founder and an architect spanning multiple industries, it feels great to solve business problems with proven messaging solutions. I want to share with you the benefits of switching from a push to a pull system, and an example of how it remedied a disaster!
I once worked on a solution in the travel industry where a travel agent would make a booking for a corporate traveller using an Online Booking Tool (OBT). A third-party Travel Provider asked if the OBT could export the booking in real-time by calling their API, as shown below.
It was a simple "real-time" solution with solid consistency. What could go wrong?
A simple task turned out to be a burden on the OBT, which had to be enhanced to:
The additional OBT components are shown below in the green box.
It was only a short time until additional travel providers also wanted to receive exported bookings. Developers had to extend the OBT, and understand the authentication and specifications of various travel provider APIs. Then, there was ongoing maintenance, such as dealing with new API versions, network issues and software bugs.
Changing the real-time system to an eventual consistency model provided the benefits discussed in the previous post.
The new design is shown in Figure 3 below by adding Azure Service Bus in between the OBT and the Travel Providers.
The (pub/sub) pattern provided the following benefits:
An incident happened where a travel provider was alerted that 1,000 bookings were waiting in their queue. It turns out that the travel provider made a firewall change, which prevented their service from processing the bookings. When the firewall issue was resolved, they knew their system controlled the number of bookings they could process, which was 2 per second. They knew that the queued bookings would take around 30 minutes to process without losing any data and that their system could handle the load. Using the priority queue pattern was also possible to ensure urgent bookings could be processed first.
In summary, if you don't have a queue anywhere in your architecture, you're missing out on some of the benefits, such as availability, reliability, and scalability. Get in contact if you would like to know more or need help to design your messaging architecture.
Are you interested in more of an introduction to messaging and queuing systems and why they are important to SaaS? You might find our blog from last week interesting.