4 ms·
How do you solve the FLP problem? e.g. Kiosk->Device: Give me $100 Device: Subtract $100 from myself Device->Kiosk: Send $100 (fail) Alternatively, what if
by sargun 6y ago
How do you solve the FLP problem?
e.g.
Kiosk->Device: Give me $100
Device: Subtract $100 from myself
Device->Kiosk: Send $100 (fail)
Alternatively, what if this happens the other direction?
- wyattpeak 6y agoAtomic transactions, as with any database. After sending the money, confirm that it arrived. If it didn't, undo the subtraction. That said, shoddy implementations of these systems often do fail in numerous ways. As an end-user, you really just have to live with it.
- sargun 6y agoWhat protocol guarantees that there is an atomic transaction, in the presence of faults, in such a system?
- lmz 6y agoThose cards typically store the last few transactions (e.g. [0] is an Android app that can display transit card usage history), so it should be possible to code idempotency into the card firmware. [0]: https://play.google.com/store/apps/details?id=com.codebutler.farebot https://play.google.com/store/apps/details?id=com.codebutler...
- texse 6y agoTechnically FLP impossibility only applies to deterministic algorithms, not randomized ones, otherwise no consensus protocol would work. So you could imagine a complicated technical solution that could work (eg. treating everything as a big Raft cluster and using Raft's membership changes every time a device is connected / disconnected). In practice the solution is to realize that failures are rare (especially compared to events like the soldier simply misplacing the card), and to have a trusted human available to resolve any issues that do occur.