admin管理员组文章数量:1307764
I use AWS Lambda function to respond to HTTP requests.
The function stores some data in a PostgreSQL database. To reliably notify interested parties of the changes, I use transactional outbox pattern.
In scope of the same transaction I store an outgoing message to PostgreSQL. Then SNS client should process outbox in a different transaction.
Ideally processing outbox should happen after I send response to the original HTTP request. The issue is that once response is sent, Lambda function freezes.
One way to work around the freeze is to use Lambda extension. Although, extension lifecycle doesn't have a hook for "Lambda call completed" event.
AWS documentation provides an example for a database that supports change data capture (.html). But that is not the case with PostgreSQL.
As of now for simplicity I process outbox before sending response, but I'd like to improve it.
What is the correct approach to use in this case?
本文标签: How to implement transactional outbox pattern with AWS Lambda and PostgreSQLStack Overflow
版权声明:本文标题:How to implement transactional outbox pattern with AWS Lambda and PostgreSQL - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741849700a2400991.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论