architecture

rakyi 2020-10-25T16:56:24.029300Z

Could someone who read Designing Data-Intensive Applications help me understand this paragraph on page 523? > If you want to ensure that the payer account is not overdrawn by this transfer, you can additionally have a stream processor (partitioned by payer account number) that maintains account balances and validates transactions. Only valid transactions would then be placed in the request log in step 1. The author unfortunately doesn’t provide further description of how would this be implemented. I don’t understand how we can avoid a race condition between this stream processor consuming the log with committed requests to update the account balances and validating new transactions.

dangercoder 2020-10-25T17:51:11.029900Z

It will be a synchronous flow for the processing of transactions for a specific account since it's partitioned by account-id. There will be no race conditions for an account

rakyi 2020-10-25T19:29:56.030600Z

> 1. The request to transfer money from account A to account B is given a unique request ID by the client, and appended to a log partition based on the request ID. So instead the request would go first to a partition based on the payer account number where it would be synchronously validated. If valid the stream processor would first update the payer account balance (used for validation only) and if that succeeds write the request to the request log?