Given the following structure. There is a partitioned (partitioned) database (MSSQL), a services layer (C # web-api or WCF), a mobile client (IOS). The goal is to organize the notification of mobile clients that one of them has made changes to the database. As far as I know, for this, you can use MS Service Broker, when a table changes, an event will be raised. In services, it can be intercepted via a SqlDependency object, subscribed to a specific request (correct it if I'm wrong). And so a few questions:
- Is it possible to configure Service Broker for notifications about changes to a specific partition (in the MSSQL realities, when database is partitioned, a separate file and file group is created for each partition).
How to organize customer notification. Before that, I implemented applications in real time using SignalR, but the client was on JS and there was an opportunity to subscribe to a specific hub. What to do in cases of iOS apps? Mobile developers insist on the long polling option. In my case, I assume that it will be necessary to capture a GET request for a timer and wait through the while loop until the SqlDependency event is raised (is this the correct approach?). But long polling captures streams and does not let go until the answer is received (is it a correct assumption). Thus, when the number of clients exceeds 1000, 1000 streams will be captured, for a rather serious period. Is the WebSocket option good for this case?
Is it possible to use the AMQP implementation (RabbitMQ or ZeroMQ) for such a case? Instead of integration through a database. In the following structure. The device sends a POST request and updates the data in the specified partition, then if the update is successful, puts the message with the necessary header into the queue, and all subscribers receive a notification, then sending a GET request for receiving data.
Thanks in advance for your attention and help.