-
Notifications
You must be signed in to change notification settings - Fork 267
Description
Hi,
I'm exploring solutions that allow me to orchestrate database transactions while reliably enqueuing jobs. I'm currently looking at River which leverages transactional enqueuing, bundling inserting a new job with changes made to data during a database transaction. This is possible because River's data model is entirely integrated within the application database, making River an integral part of the application. If a transaction is rolled back, the job goes with it.
Hatchet has a different architecture using an independent engine service, with it's own data store, that takes care of all the orchestration. I was wondering: To what extent would Hatch guarantee reliable worker registration (and returning errors) during an ongoing database transaction in a way that's comparable to the level of consistency that River offers through transactional safety?
Hatchet's documentation seems to hint at encapsulating database actions as well as long running processes as child tasks in a single Hatchet workflow. So, given a DAG workflow, how would I roll back a database transaction in a parent task, if a child task fails or times out, or vice versa? But would that be the correct approach?
Alternatively, suppose I start a database transaction in my application and then register a new job in Hatchet, triggering a workflow, Would it be possible to either reliably rollback the transaction if the job fails, or avoid the job from running / being registered at all if the transaction fails? Barring scenario's where intermittent failures on the wire leave the application and Hatchet in an inconsistent state (i.e. job registered, but the return ack message never reaches the application), that is.
I was wondering which insights the Hatchet team might offer on these questions. Thank you!