Today when you write an application, your application needs data. This data can be from some backend system or from some external source. This backend system can be other applications or services. Also, the communication pattern has changed. Applications are no longer limited with simple request-response patterns and need more robust message exchange patterns, triggered by multiple events. This gives rise to a question of the type of communication method you use for your application. The traditional method is not enough and hence an advanced “Messaging System” is needed. Also, your application needs some sort of infrastructure which is difficult to maintain and ensure available. Here is when Azure PaaS computing model of Service Bus comes into the picture.
Traditionally a business requirement is addressed as a separate process and usually, you will find duplication of functionality at some stage. As in the example above, considering an application that has an Email, Calendar and Play Store functionality each is storing login and user details separately. This will create a lot of complexity and inefficiency. Login and User details will have to be synchronized every time for any changes. Also, a user will have to create separate accounts for each process and will have to remember the same for access.
To fix the issue, the approach is to identify the common tasks and implement them by decoupling the functionality from each process and build a separate standalone application for authentication and user details.
As you can see in the figure above, the shared task for maintaining account related information is separated from the individual processes and is implemented as a service. This Asynchronous messaging scenario called, “Message Bus” is more efficient and highly scalable. It is defined as:
“A Message Bus is a combination of a common data model, a common command set, and a messaging infrastructure to allow different systems to communicate through a shared set of interfaces”
– Enterprise Integration Patterns
Azure Service Bus messaging is a reliable system to deliver information. It is flexible enough such that your applications or services may interact with each other either it be running in the cloud or on-premises. Azure Service Bus is also a multi-tenant messaging system i.e. a single service is shared across by multiple users. There are multiple communications options in Service Bus like Queues, Topics, Relays and Event Hub. You may use one or all four types of communication option depending on the type of application you are designing.
As mentioned earlier, there are four different messaging options available in Azure. Below is a brief description of each of them.
Imagine you walk into a mall and after your shopping, you go towards the checkout counters. At the counter, you find other customers waiting in a “queue” for their turn to be addressed by the cashier. The first customer in the queue is addressed first by the cashier. The concept is the same in the Service Bus queue. A sender sends a message to the Service Bus queue and the receiver addresses the message.
More about implementing Queues in Service Bus
More about monitoring Queues in Service Bus
Learn more about Netreo.