3 ms·
This and other concurrency problems often fall into the “you just have to know how to not get it wrong” camp. If you know to write an automated test for it, you
by hmeh 3y ago
This and other concurrency problems often fall into the “you just have to know how to not get it wrong” camp. If you know to write an automated test for it, you probably know enough to reason about it and get it right. For very important things, sure, maybe write a test, but these tests are very expensive to write and maintain. It’s often cheaper to recognize (and train other team members to recognize) these scenarios and use a higher isolation level. Postgres makes this easy because serializable doesn’t come with a huge perf penalty (mostly memory, I believe).
I’m strongly in the TDD camp too, btw. So I don’t say this flippantly. I appreciate this article bringing further awareness to this.
Also, I cannot recommend partitioning (and event sourcing) enough to eliminate and simplify these problems.
Article on partitioning: https://github.com/aaronjensen/software-development/blob/master/partitions-and-compositions.md#partitions-and-compositions https://github.com/aaronjensen/software-development/blob/mas...