zlacker

[return to "Postgres is a great pub/sub and job server (2019)"]
1. aneesh+qO[view] [source] 2021-12-18 06:33:24
>>anonu+(OP)
I think the key concept here is atomicity. If some API is responsible for creating a job, storing it in the database AND publishing it can never be an atomic operation. Both the database and pub/sub servers are separate network connections from the application server. For example, if you save the record first and then publish, It's quite possibe that you save the record in the database and then lose the connection to the pub/sub server when publishing. If this happens, you can never know if the pub/sub server received the request and published it. In systems where it's critical to guarantee that a record was saved and guarantee that it was published as well, the only way to do that is by using a single external connection - in this case to a Postgres DB. We've used the same setup on an AWS RDS t2.medium machine to process over 600 records/second.
◧◩
2. richar+Bn1[view] [source] 2021-12-18 13:47:14
>>aneesh+qO
You can use transactional outbox pattern to solve this.
[go to top]