MERGE and DISTINCT subscription modes differ in several aspects, where the main difference is in the way the snapshot is defined.
To resume:
As
MERGE mode implies a "state" that has to be reproduced to the client:
- the updates represent changes in the state, so the Data Adapter is allowed to send to the Server only the modified fields;
- the snapshot is the current state (which can be carried by a single pseudo-update);
- in case of multiple updates in short time, filtering is encouraged, rather than queueing, because the client is expected to only display the current state;
as a consequence, the default buffer size limit is 1;
filtering consists in merging the updates, so that a cumulative update is sent, which allows the client to immediately turn to the current state.
As
DISTINCT mode implies a source of "news" on some topic to be sent to the client:
- the updates represent new observations and are unrelated to one another, hence the Data Adapter must send all the relevant fields;
- the snapshot is the recent history of observations, so that the client could fill a static list at startup (each historical observation can be carried by a pseudo-update);
the size of the recent history to be preserved has to be configured and cannot be unlimited;
- in case of multiple updates in short time, queueing is preferred to filtering, because the client is interested in showing all observations;
as a consequence, the default buffer size limit is the maximum allowed;
yet, if an observation may get filtered: in this case, it is lost for the client;
but this implies that many newer observations are available, which might cause the discarded observation to actually become unimportant.
Moreover, about both points 3, let's remind that the buffer size can be freely configured for each subscription and that "unfiltered" subscriptions can also be requested.
[Originally written by Dario Crivelli]