incubator-seata-go icon indicating copy to clipboard operation
incubator-seata-go copied to clipboard

Database persistence for seata-go Saga state machine

Open ptyin opened this issue 1 year ago • 1 comments

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 StateLangStore interface.

2. State Log Storage - StateLogStore:

  • Develop a storage mechanism for state logs. Create a StateLogStore module 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 DbStateMachineConfig class 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:

  1. State Machine Definition (JSON) Storage - StateLangStore:

    • Define the StateLangStore interface for storing state machine definitions in JSON format.
  2. State Log Storage - StateLogStore:

    • Implement the StateLogStore module to handle the storage and retrieval of state logs.
  3. Database Configuration Implementation - DbStateMachineConfig:

    • Create the DbStateMachineConfig class to manage database-related configurations for the state machine.
  4. 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.

ptyin avatar Jan 03 '24 04:01 ptyin

assign me

ptyin avatar Jan 04 '24 07:01 ptyin