Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do we share data between two different services
    text
    copied!<p>I am currently working on a web service which is periodically polled. It does not store its state and is instantiated everytime it is queried. Essentially, it retrieves the state of other external entities e.g. databases and delivers it back to the requester.</p> <p>Recently, the need to store state as arisen in that</p> <ul> <li>There is the need to continously collect data from a particular source and store the bits that are important/relevant</li> <li>There is the need to collect the aggregate of a particular data source over a period of time</li> </ul> <p>I came up with the following idea: <img src="https://yuml.me/diagram/scruffy/class/%5BWeb%20Service%20that%20is%20polled%20periodically%5DRead%3C-%5BStatic%20Shared%20Data%5D%2C%20%5BStatic%20Shared%20Data%5DWrite%3C-%5BService%20that%20continously%20collects%20%26%20processes%20data%5D" alt="alt text"></p> <p>My main concern here is the fact that I am using a static class (essentially a global) to share data between the two services. Is there a better way to doing this?</p> <p><strong>edit:</strong> Thanks for the responses thus far. Apologies for the vaguesness of this question: just trying to work out what is the best way to share data across different services and am unsure as to the specifics (i.e. what is required). The platform that I am developing on is the .NET framework and both services are simply WCF services hosted as a Windows service.</p> <p>The database route sounds like the most conventional way to go - however I am reluctant to go down that path for now (mainly for deployment/setup issues; it introduces the need to create new tables, etc in addition to simply installing the software) for at this point the transfer of relatively small amounts of data. This may of course change in the future and going the database route might be the way to go at that point.</p> <p>Is there any other way besides adding a database persistance layer?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload