⬆️ ⬇️

Message Queue

Message Queue





This post talks about message queues - why you need to know about them, think when planning an architecture, and use them in your application.



Why message queues?


Messages, along with the blocks of calculation and storage, make up the three main blocks in almost every block diagram of the system. Message queues are essentially the link between the different processes in your applications and provide a reliable and scalable interface to other connected systems and devices.

The turn - the data structure with the discipline of access to the elements of "first come - first come". Adding an item is possible only to the end of the queue, sampling is only from the beginning of the queue, and the selected item is removed from the queue.



Using Message Queuing


Ten reasons why message queues are a vital component for any architecture or application:



I can tell you more about practical recommendations - how and why people use message queues, but perhaps next time.

In general, the applications for message queues include:

')



The above areas should give you ideas on where message queues can be used. If they are not a standard part of your toolkit, you probably missed something that can reduce the complexity of your system and solve a bunch of problems.



Why SaaS?


Adding message queuing for cloud applications only makes sense if there is a net gain in terms of installation and operation. Adding an additional architectural layer responsible for queuing messages is not an easy task, especially if you decide to use your own solution or install third-party servers, as this will add additional costs for monitoring, tuning, managing and affecting the overall reliability and security of the system.



When message queues are easy to install, easy to use, highly available, and extremely reliable, everything becomes much easier.

Here the analogy of obtaining energy is appropriate. Progress ranged from windmills and coal-fired furnaces to industrial power plants and power lines. This last step, the industrialization of energy, changed the face of industry in the world. This reduced construction and manufacturing costs, changed cities, factories, and homes, and allowed new inventions, services, and businesses to be created.



Similarly, by connecting Message Queuing services, developers no longer have to support a huge set of services running on multiple servers and not be afraid of downtime due to system failure. In today's world, service providers take responsibility for managing servers, APIs, and other resources, and a developer abstracting from most physical constraints can concentrate on implementing his idea.



Benefits of migrating to cloud-based message queues include:






Where to begin?


There are not so many different services that provide message queue services:



In this case, SQS provides 100,000 free messages (I understand that for the entire period of use), IronMQ - 10,000,000 free messages per month (provided that you enter credit card information), and StormMQ is currently in a closed beta. Vplane availability of examples of use and libraries in the leaders of SQS, although IronMQ also supports the most popular languages ​​(Ruby, Python, C #, Java ...) and examples of use are already enough.



PS I hope I managed to put a drop of doubt in the choice of “put my MQ server or use a third-party service” and interest in existing SaaS solutions in the field of message queues.



upd : added Windows Azure Queues

Source: https://habr.com/ru/post/165981/



All Articles