Microservice Pattern : Transactional Log Trailing vs Polling Publisher

Viewed 1417
2 Answers

I have just started to discover microservices world. I know a bit about these two hope this helps you. In order to use these two pattern, you have to already implement transactional outbox pattern. These two pattern comes after that and these two answers the question "How can I deliver the domain object messages to the relevant microservices keeping the Atomicity principal?"

  • Polling publisher pattern: Sender periodically queries the OUTBOX table if there is a record, publishes this record to the message broker and after sending message it deletes that record.

  • Transactional Log Tailing: A bit sophisticated solution, third party frameworks are used. General obligation of these frameworks is that it listens commit logs and publishes each change as a message to the message broker.

You have asked question one year ago. If you enhance your knowledge about these patterns please share them :)

The frequent DB queries may become too expansive in large systems. Also, not all NoSql DB supports according queries. NoSql dBs request a document, this can be not so efficient as expected. That’s why transaction log may be more preferable. But as for me for nasal and postgresql polling works well. More details in Kris Richardson’s book.

Related