Effect CommunityEC
Effect Community2y ago
2 replies
attila

Incremental Migration of Transaction-Wrapped Code

How do you incrementally migrate code that is wrapped in transactions? For example, you have an endpoint for creating a resource X. That comprises of 4 DB queries all wrapped in a single transaction. When we migrate, we would have to rewrite all 4 queries, so they can be run in the Effect sql's transaction. However, the transaction wrapping happens on the top level, close to the request handler. This means the entire action has to be an Effect from top to bottom. However, the situation gets more complicated once any of those DB queries are re-used someplace else, which is super common in event-sourced architectures. What you end up with is that the entire app has to be re-written in Effect all at once 🙁 Any ideas how to make this more incremental?
Was this page helpful?