vendredi 8 septembre 2017

Sharing cache between two services (in a logical boundry)

We are developing an application where IoT messages need to be read from Azure IoT hub, dumped into database and maintain a current state property of some business objects.

We have a background job that perform this operation. But these current states can be requested by a webApp/App Services. We have two choices:

  1. Update the same background job which will expose some endpoints, and other services can use these endpoints to access the current state (stored in cache). But this approach is breaking Single responsibility principle to some extent. And scaling will depend on two different factors (Frequency of telemetry data and no of request for current state).

  2. Another approach could be to create another WebService that will read this current state (from cache) and serve the read request from Web/App tier. But now, two services will be sharing cache (Although these are working on same business part, so can be considered a single business service but will be deployed separately).

Please suggest.

Aucun commentaire:

Enregistrer un commentaire