I have a system running in Azure that accepts messages via a REST endpoint. The customer has a certain number of devices that send some data for example temperature and we present this data in a web interface. The part of the system that accepts messages is separate from the website (microservices!) but they access the same database (not so microservices?). I am building a new functionality that allows the customer to setup notifications. For example the customer defines that if any of his devices sends a temperature above 50°C then an e-mail should be sent. The notifications can be instant (or of relatively short period) or aggregated (daily, monthly, etc.).
The way I had built these things in the past on premise was to setup a Windows Service that polls the database periodically gets the notification definitions, gets the corresponding messages and sends the proper e-mails be it instant or aggregated. However something tells me that this way is not cloudy at all. Am I supposed to use a message queue, a service bus or something else? If yes which one? What about aggregated notifications? If not what is the best equivalent of a Windows Service in Azure today for my use case? Am I still supposed to use a Worker Role?
Also note that in the future the messages may be taken out of the relational database and put in a NoSQL solution and in practice they are much more complex than one number (the REST endpoint does some processing before storing them in the DB). The REST endpoint does have access to the notification definitions and could potentially process notifications itself but I'd like to avoid that because I like the clean separation and simplicity of the separate services I currently have. Also processing the message when received does not solve the aggregation problem. In case it matters we expect relatively small number of users but great number of messages and hopefully great number of devices sending messages. In case it is not clear there are multiple users each of them getting notification for his own data.