0

I am working on Azure SQLDB- and idea is to send a messages to signalR hub which will connect with the clients. The volume of traffic will be low (around 1000-2000 messages per day at maximum, and 1-2s latency is fine)

Rather than poll at periodic intervals, we want to use Azure functions to make the data pull, only when there is an update. I understand AzureDB has functional limitations and triggers cannot invoke the Azure function directly due to lack of CLR support

Azure SQL Database trigger to insert audit info into Azure Table

What are the best options

  • Should I populate a queue - which acts as a trigger for function? Again,how do I populate this queue?
  • I can use Service Bus - but would prefer to keep it simple

Appreciate any pointers and guidance

Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36
user7995357
  • 151
  • 10

1 Answers1

2

So, I guess you have something, let's call it Client, which update data in SQL Database:

Client -> Database

So, you have roughly two options:

  1. Change the Client to also insert a queue item every time it updates the database. Then your function will be triggered by queue items, and will send the notifications.

    Client -> Database
           -> Queue -> Function -> SignalR
    
  2. Make your function periodically poll the database and detect updates itself (timer trigger).

    Client -> Database <- (pulls) Function -> SignalR
    

    It sound like you already poll from the clients at the moment, so it probably won't get worse. But 1-2s target latency will mean polling every second, which might be expensive depending on the query.

Mikhail Shilkov
  • 34,128
  • 3
  • 68
  • 107