3 ms·
This is pretty cool, but in my experience critical path code generally has side effects and most code is not idempotent. That is to say it may not be safe or fe
by mberning 3y ago
This is pretty cool, but in my experience critical path code generally has side effects and most code is not idempotent. That is to say it may not be safe or feasible to run the old and new code in parallel, without some special considerations. Think bidding on a auction item or transferring a bank balance.
- rockwotj 3y agoSure but IMO most code can and should be structured to decouple the side effect from the logic that is being replaced. Example in the transferring a bank balance, you have some storage DB you interact with, but that is an abstraction and when you run the dry run of the new code you can have an implementation that just does verification on the data from the real implementation. Anyways, it does take discipline and effort, but you can still safely make changes in this manner.
- Manfred 3y agoThe library is specifically meant for safely replacing legacy implementations and they generally aren't that well structured.
- runako 3y agoI would imagine that applications that use a relational database could use transactions to reduce the impact of non-idempotent code.