{
  "repo": "tidbcloud/api-gateway",
  "binary": "ddbtoredis",
  "binary_path": "ddbtoredis/cmd/main.go",
  "dependencies": {
    "DDBToRedisLifecycle.LoadConfigAndTracing": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "/etc/ddbtoredis/config.yaml exists"
          ],
          "operations": [
            {
              "operation": "READ SYNC CONFIG",
              "trigger": "Load Redis and DynamoDB settings before starting the syncer",
              "conditions": [
                "viper.ReadInConfig() succeeds"
              ],
              "implementation": "main -> viper.ReadInConfig()"
            }
          ]
        }
      },
      "services": [
        {
          "name": "jaeger",
          "target_interface": "tracing backend",
          "operation_type": "tracing",
          "conditions": [
            "titracing.InitJaeger(...) succeeds"
          ],
          "operations": [
            {
              "operation": "INITIALIZE TRACING",
              "trigger": "Enable tracing for the sync worker",
              "conditions": [
                "InitJaeger succeeds"
              ],
              "implementation": "main -> titracing.InitJaeger(\"ddbtoredis\")"
            }
          ]
        }
      ]
    },
    "DDBToRedisLifecycle.StartSyncer": {
      "infrastructure": {},
      "services": [
        {
          "name": "redis",
          "target_interface": "read/write cache store",
          "operation_type": "redis",
          "conditions": [
            "Redis client is created successfully"
          ],
          "operations": [
            {
              "operation": "WRITE SYNCED STATE",
              "trigger": "Persist synchronized records into Redis",
              "conditions": [
                "syncer.Run() is executing"
              ],
              "implementation": "main -> NewRedisReaderWriter(...) -> NewSyncer(...).Run()"
            }
          ]
        },
        {
          "name": "dynamodb",
          "target_interface": "table read and stream subscription",
          "operation_type": "aws_api",
          "conditions": [
            "DynamoDB reader and stream subscriber are created successfully"
          ],
          "operations": [
            {
              "operation": "READ TABLE AND STREAM EVENTS",
              "trigger": "Stream DynamoDB changes into Redis",
              "conditions": [
                "syncer.Run() is executing"
              ],
              "implementation": "main -> NewDynamodbReader(...) + NewDynamodbStreamsSubscriber(...) -> syncer.Run()"
            }
          ]
        }
      ]
    }
  }
}
