9 ms·
SQL Server has included a message queue capability for a while now. It’s called SQL Server Service Broker: https://learn.microsoft.com/en-us/sql/database-engin
by gavanm 3y ago
SQL Server has included a message queue capability for a while now. It’s called SQL Server Service Broker:
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-service-broker?view=sql-server-ver16 https://learn.microsoft.com/en-us/sql/database-engine/config...
I haven’t had the opportunity to use it in production yet - but it’s worth keeping in mind.
I’ve helped fix poor attempts of “table as queue” before - once you get the locking hints right, polling performs well enough for small volumes - from your list above, the only thing I can’t recall there being in sql server is a LISTEN - but I’m not really an expert on it.
- EvanAnderson 3y agoCame here to mention Service Broker. I've used it in production in multi-server configurations for a number of years. It works really well but it's terribly obscure. Nobody seems to know it's even there. The learning curve is steep and there are some easy anti-patterns you can fall into. Once you grok it, though, it really is very good. The LISTEN functionality is absolutely there. Your activation procedure is invoked by the server upon receipt of records into the queue. It's very slick. No polling at all.
- halfcat 3y agoAlso Azure is adding SQL Server trigger support https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-azure-sql-trigger https://learn.microsoft.com/en-us/azure/azure-functions/func...
- dagss 3y agoThis stuff has a latency measured in minutes though, limiting the usecases a lot.