Benefits of Using MS Queue

How can you use something like MSMQ with scalability and reliability? In the scenario of one web server to one database server, does it even help?

Any comments or links would be greatly appreciated. Thanks

EDIT: WCF will be launched on the web server, displaying SOAP style web methods. There is also the possibility, looking to the future, that there may be several web servers.

+4
source share
3 answers

Queues (especially fault tolerant and persistent queues) provide communication between components and ultimately allow queue authors to be asynchronous with readers. This means that readers and writers can be increased depending on the use of the queue.

Consider a simple example of serving web requests. If a heavy operation is queued, another set of components can read the queue and process the request without affecting the author, and thus allows the HTTP listener to serve more requests because it is not connected. As the number of items in the queue increases, readers can be added to the queue to process them.

From the point of view of reliability, if the queue is reliable, the messages between the components are not lost, so communication is inherently more reliable. Readers and writers can go up and down, but as long as the messages are safe, you have the foundation for a more reliable system than the one where the messages may be lost.

In fact, you are creating systems with lower runtimes, and therefore a single point failure does not necessarily extend throughout the system. Allow the use of fault tolerance strategies more successfully.

+2
source

The web server talking to the database is not like a scenario in which MSMQ can be useful.

However, if you have a web server, a domain server, and a database server, then this is all different. In this case, the web server can communicate with the domain server through MSMQ (with guaranteed delivery and transactional method - reliability). When you introduce additional web servers, the architecture will not change a bit, so scalability is achieved.

It's always good to read about CQRS.

+1
source

Yes, there is a value in 1 script of a web server or database server if you need asynchronous processing and a reasonable guarantee that the tasks queued will be completed. It does not provide high availability (the server running MSMQ may fail, among other things).

Provide implementation-specific details if you would like more information.

0
source

All Articles