Azure Queue Storage vs WCF Services
Could anyone please whether it's a good idea to expose messages via Azure Queue storage or via WCF Services?
开发者_开发知识库if we expose messages via Azure it will be resful service and it's more reliable. Any thoughts?
Regards
There's nothing wrong with using WCF for inter-role communication within Azure.
The reasons for using Azure Queue Storage are similar to those for choosing queues in any other environment; it simplifies asynchronous, disconnected processing. You can have as many instances of a worker role as you like consuming entries from a queue providing for high scalability and inherent load balancing.
There are reasons that you may not want to use queue processing; if your client (maybe a web role) needs to wait for a message on a queue to be processed, you need to implement some way of blocking or polling and you need some method to communicate the result back to the client. The operation may not be processed in a timely manner and you need to be sure that this doesn't cause a dependency issue.
It's a good choice for fire-and-forget modes of operation.
Also, a queue-based approach needs to be self-supporting in terms of execution and that typically means using a worker role. If you have no other reason to implement a worker role, you could be consuming VMs (and therefore spending money) needlessly.
However, WCF services can be exposed from your existing web roles, so in a small-scale environment, may be more cost effective.
精彩评论