Hacker News new | ask | show | jobs
by andriosr 2432 days ago
Great write up, but I don’t see how it could scale with the pessimistic lock of Spanner.

Updating the current balance of big merchants, which are receiving multiple payments per second seems to create a lot of lost transactions, with the locking of the balance.

That would generate deadlocks in RDBMSs, curious to know if Spanner is able to scale it.

I built a similar system using DynamoDB and optimistic locking, and for that I had to remove concurrency of updates in the same document, meaning you can get ˜30 updates of the same document per second, with each update taking ˜30 milliseconds.

1 comments

That is the kind of content I was hoping for in this article. The review of double-entry accounting is nice and all, but the scale details would have been nice beyond hand-waving "we left it to Spanner, and so we followed Spanner's rules".

Similarly a quibble about the "immutable" in the headline given that they are still using a mutable field at the book level for balances to make them easier to query. I guess I was hoping they'd have solved a nicer merkle tree balancer or something for balances. Not that I was hoping for a "blockchain" solution, but something smarter than blockchain for "centralized" trust environments like Square.