2 ms·
I think this article covers many of the main points, but could be worded/structured better. There are terms of art that more precisely refer to the concepts you
by theptip 3y ago
I think this article covers many of the main points, but could be worded/structured better. There are terms of art that more precisely refer to the concepts you need.
For “using floating point data types”, it’s even worse; you often need to use strings, for example if you need to store a bank account number “01234567789” will have the leading zero stripped if you use a numeric type.
“Updating transactions” would be better phrased as “use an append-only log / evented architecture”. (Also, “use a double-entry ledger” is probably the most valuable advice I could have sent myself prior to getting into FinTech.)
“Be careful with retry” should be more strictly “use idempotent operations” and link to the canonical Stripe article on idempotency keys (https://stripe.com/blog/idempotency https://stripe.com/blog/idempotency).
Another important one to think about is bitemporality. “Created at” vs “effective at”. Not obvious at first and you’ll have some painful migrations if you don’t build it in. Fowler has a good overview here: https://martinfowler.com/eaaDev/timeNarrative.html https://martinfowler.com/eaaDev/timeNarrative.html.
Edit to add - the advice that maybe using a NoSQL database is pretty bad IMO. I’d advise in the opposite direction - use SERIALIZABLE isolation in a SQL database. Read up on your Aphyr blog posts before trying to do anything distributed. Be paranoid about race conditions / serialization anomalies. If you eventually hit performance issues you need to think hard about what anomalies your access patterns might be subject to. (Obviously HFT won’t use serializable SQL).
- ahtihn 3y ago> if you need to store a bank account number “01234567789” will have the leading zero stripped if you use a numeric type. This goes for any "number" that is actually an identifier. Phone numbers aren't really numbers either for example. Rule of thumb: if it doesn't make sense to do math with it, it should probably be a numeric type unless there's a very good reason.