Accepting Potential Duplication
If you had an uneasy feeling as you went through how we handled idempotence here, that’s awesome that you’re developing a sense for it. Before publishing the video, we checked to see if the video was already done. We only have a single video-publishing instance, so we don’t have to worry about two or more instances competing with one another. However, we could very well transcode the video and get restarted due to deployment or crash before writing the VideoPublished event. When it restarts, it’ll see the PublishVideo command and do it all over again.
Transcoding videos is cheap, and we absolutely cannot accept failing to transcode the videos—they don’t go out to our viewers if they don’t get transcoded. Also, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access