• Home
  • blog
  • Builders.flash about implement...
Builders.flash about implementation of nature that should be serverless (message edition) "Serverless" dedicated to developers who are worried about the 2nd

Builders.flash about implementation of nature that should be serverless (message edition) "Serverless" dedicated to developers who are worried about the 2nd

In the first part of this series, we introduced what is what it should be. The concept of "the result is the same whether a certain operation is performed once or multiple times", for example, 0 and 1 should be in the real numbers (0 or 1 in a certain number. The same result no matter how many times you hang). In the previous article, an example of order processing, an example of a flow processing at the time of recovery from a disability, as a typical basic pattern of implementation that guarantees the should be, is (1) checking ((2) output when input, (2) output. Explained the time check method, ③ (3) correspondence to processing to transaction type. In this series, he introduces the specific implementation that realizes the essentials, assuming the use of AWS serverless services. Since there are many points to consider the realization of what it should be, we will explain how to implement what to implement in the future while taking up individual use cases.

builders.flash✨ サーバーレスにおけるべき等性の実装 (メッセージ編) サーバーレスが気になる開発者に捧ぐ「べき等性」ことはじめ 第 2 回

The first article explained that the client could send a duplicate request by retry processing when using the backend service.For example, if you send an order message to request an order service to an order service, if some error occurs in the client side and a retry process is performed, the same order message is used for multiple order services.It may be sent.

In this second article, we will discuss the implementation of such a case.Here, as a check method at the time of entry, we will discuss the means to avoid duplication of data in the first place.It is a concept that excludes the duplication of data generated by retry processing at the time of transmission before writing to the data store.In this article, I would like to focus on the duplicate exclusion of this message and explain how to use the AWS service to eliminate the duplication of messages.

AWS services that can be used when sending messages from clients include Amazon Simple Notification Service (hereinafter, Amazon SNS) and Amazon Simple Queue Service (hereinafter, Amazon SQS).This article introduces how to use these Amazon SNS and Amazon SQS to eliminate messages.There are various ways to check input duplication, but instead of implementing it yourself, you can use the Amazon SNS and Amazon SQS functions to easily implement duplicate exclusion.