Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One type of partial order would be that a producer puts all the messages that are related in the same queue, so that A always precedes B. Basically the invariant becomes:

If a consumer sees an event B, it will have certainly have seen the event A before that.

Assuming business logic is correctly written, that saves you from having to write certain retry logic on the B handlers. This requires the message queue to be always available. If it goes down, the system would not make progress (like a db - in fact the MQ is a db).

Once you add more actors/nodes to the same related events, maintaining a “causal order” can be very tricky and subtle, especially if you have an MQ and a DB as multiple sources of truth. So I’m not exactly endorsing it, even though MQ-as-a-DB (aka event sourcing) is a very interesting idea.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: