incubator-seata-go
incubator-seata-go copied to clipboard
Database persistence for seata-go Saga state machine
This is a subtask under the #618
Description:
This feature involves the storage aspect of the state machine and has dependencies on both the 1.1 Domain Model and 1.2 State Machine Configuration. The primary focus will be on creating SQL templates, with reference to the seata-engine-store module.
Implementation Details:
1. State Machine Definition (JSON) Storage - StateLangStore:
- Implement a module for storing state machine definitions in JSON format. This could be achieved through a
StateLangStoreinterface.
2. State Log Storage - StateLogStore:
- Develop a storage mechanism for state logs. Create a
StateLogStoremodule to handle the storage and retrieval of state logs.
3. Database Configuration Implementation - DbStateMachineConfig:
- Implement the database configuration related to the state machine. Introduce a
DbStateMachineConfigclass responsible for configuring the database settings.
4. SQL Templates:
- Focus on writing SQL templates for the state machine storage. Refer to the seata-engine-store module for guidance on structuring the SQL templates.
Next Steps:
-
State Machine Definition (JSON) Storage -
StateLangStore:- Define the
StateLangStoreinterface for storing state machine definitions in JSON format.
- Define the
-
State Log Storage -
StateLogStore:- Implement the
StateLogStoremodule to handle the storage and retrieval of state logs.
- Implement the
-
Database Configuration Implementation -
DbStateMachineConfig:- Create the
DbStateMachineConfigclass to manage database-related configurations for the state machine.
- Create the
-
SQL Templates:
- Focus on writing SQL templates for state machine storage, taking inspiration from the structure in the seata-engine-store module.
By completing these steps, we aim to establish a robust database storage system for the seata-go state machine, encompassing the storage of state machine definitions in JSON, managing state logs, and configuring the database settings through DbStateMachineConfig.
assign me