Member-only story

Understanding Exactly-once Semantics

Explaining how to achieve end-to-end exactly-once guarantee

Chunting Wu
Starbugs Weekly 星巴哥技術專欄
7 min readOct 31, 2022
Photo by Aron Visuals on Unsplash

Previously, when discussing message queues, we mentioned that when selecting a message queue, we should consider its delivery guarantee. Depending on the needs, there are different requirements for the delivery guarantee. The more critical the application, the higher level of guarantee is required.

There are three different levels of delivery guarantees, ranging from weak to strong as follows.

  1. At most once
  2. At least once
  3. Exactly once

When we define a delivery guarantee, in fact, we need to understand the scope of the guarantee. In an end-to-end delivery guarantee, there are three different paths that work together to define a complete end-to-end delivery guarantee.

These three paths are as follows.

  • Producer Perspective
  • Consumer Perspective
  • Sink Perspective

An end-to-end delivery guarantee is actually determined by the weakest of these three paths. For example, if the producer has an exactly-once guarantee, but the consumer can only achieve at-least once, and the sink has at-least once too, then end-to-end is at-least once guaranteed.

Starbugs Weekly 星巴哥技術專欄
Starbugs Weekly 星巴哥技術專欄

Published in Starbugs Weekly 星巴哥技術專欄

一群技術人想要寫出一些好文章所建立的技術專欄。每週二一篇原創文章、一封電子報,歡迎大家訂閱!主網站: https://weekly.starbugs.dev/。

Chunting Wu
Chunting Wu

Written by Chunting Wu

Architect at SHOPLINE. Experienced in system design, backend development, and data engineering.

No responses yet

Write a response