<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Delivery on 水源一二三</title><link>https://theweidi.net/tags/delivery/</link><description>Recent content in Delivery on 水源一二三</description><generator>Hugo</generator><language>zh-TW</language><lastBuildDate>Wed, 05 Jan 2022 06:17:34 +0000</lastBuildDate><atom:link href="https://theweidi.net/tags/delivery/index.xml" rel="self" type="application/rss+xml"/><item><title>Exactly-Once Delivery，這個需求做不了</title><link>https://theweidi.net/you-cannot-have-exactly-once-delivery/</link><pubDate>Wed, 05 Jan 2022 06:11:40 +0000</pubDate><guid>https://theweidi.net/you-cannot-have-exactly-once-delivery/</guid><description>&lt;p&gt;&lt;a href="https://bravenewgeek.com/you-cannot-have-exactly-once-delivery/"&gt;https://bravenewgeek.com/you-cannot-have-exactly-once-delivery/&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="小小摘要"&gt;小小摘要&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Distributed systems 就是 trade-offs 的權衡。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;（傳統）理論上不可能實作出 exactly-once delivery，任何跟你說做得出來的都是&lt;em&gt;唬爛&lt;/em&gt;你或是不了解什麼是 distributed systems。實務上可以透過 idempotent （同樣的訊息處理兩次不影響）或是 deduplication 來實現同樣效果。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;於是我們只能從 at-most-once 跟 at-least-once 中做選擇，而大家可能都選了 at-least-once。&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="延伸閱讀"&gt;延伸閱讀&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://queue.acm.org/detail.cfm?id=2745385"&gt;There is no now&lt;/a&gt;in a distributed system.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.ibm.com/cloud/learn/cap-theorem"&gt;CAP Theorem&lt;/a&gt; = consistency, availability, and partition tolerance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Amazon SQS FIFO queue 有支援 &lt;a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html"&gt;exactly-once processing&lt;/a&gt;，但實際上也是透過 deduplication 跟 acknowledgement 機制來&lt;em&gt;實現&lt;/em&gt; (fake it)，如&lt;a href="https://ably.com/blog/sqs-fifo-queues-message-ordering-and-exactly-once-processing-guaranteed"&gt;這篇&lt;/a&gt;文章所說明。&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>