views:

98

answers:

1

Hi Folks, I have to write some information to SQL Server from a web application. But to minimize the delay I want it to be asynchronous operation using Message Queue.

I can create a Queue and post a Message (xml serialized object to be stored) to the queue.

What do I need to do to write that message from Queue to database?

+1  A: 

There is no need to involve MSMQ into this, unless you want to nose dive the performance. SQL Server already has queues. See Asynchronous procedure execution.

Remus Rusanu
Will it really degrade performance if I use MSMQ? I want to use it to improve performance!
TheVillageIdiot
hey @Remus it is nice article but can you point me to something which tells about service broker stuff from begning?
TheVillageIdiot
For intro try this: http://msdn.microsoft.com/en-us/library/ms345108(SQL.90).aspx and http://msdn.microsoft.com/en-us/library/ms166100.aspx
Remus Rusanu
MSMQ performance: when dequeueing from MSMQ to do database processing the MSMQ and the SQL Server have to be enrolled into a full fledged, MSDTC driven, distributed transaction, with two-phase commit and all the works. Distributed transactions, at best, can achieve throughput of hundreds per second and even tens per second. Service Broker on the other hand is fully contained inside the SQL Server and all transactions are local. Local transactions can easily achieve throughput of thousands per second.
Remus Rusanu
though not exactly solved it but your answer and comments gave me a direction to look into, Thanks!
TheVillageIdiot