We are planning to expose a service (web or not, but this is another discussion) to provide SEM campaign metrics data. The developer is proposing that the consumer calls the service and we provide only the delta since the last call. This means that on each call, we would store the requester and the timestamp of the call so that on the next call, we would provide only the data that have not been "consumed". As far as I'm concerned, I don't really feel comfortable with this option and I would like to have some opinions on this.
Is it really a good practice ? Shouldn't the caller be the one managing the data he wants to retrieve by offering date filters input ? Is it an SOA acceptable practice ?
Thank you.
There isn't going to be a right or wrong way of doing this, I'm afraid. You could even have both.
If the client can be identified it is possible to keep track of the last position. This would allow the client to not have to keep track of the position.
On the other hand, having the client request what data they need allows them the freedom to start from position 0 again, if the need arises or if another processing stream is required.
Either way, you would probably want to limit the number of responses as your server could get bogged down if a client starts at position 0 and you have a million entries to return :)
I would opt for the client handling the request, though.