Basic pubsub architecture question. At a high level, when designing pubsub, I sometimes face a choice between two architectures:
- Publish mutations or "new-state".
Some DB state is mutated, and publishers notify of that change via pubsub. But they include enough information in the message so that the subscriber doesn't need to do a look-up on the DB. Imagine the subscriber has a cache of the DB. It could receive the mutations or new-state, and update its cache without doing a look-up.
- Notification-and-check The publishers only notify that "there is a new change", which prompts the subscriber to pull the latest from the DB. This is more robust IMO. The pubsub may not guarantee order of delivery, and this architecture is robust to that, while #1 is not, if the mutations are order-sensitive.
My question is, is there a common name for these 2-types of architectures? Thanks!