{
  "repo": "tidbcloud/tidb-management-service",
  "binary": "regional_proxy",
  "binary_path": "serverless-global-service/cmd/regional_proxy/main.go",
  "dependencies": {
    "RegionalServerProxyService.GetDataByIds": {
      "infrastructure": {},
      "services": [],
      "notes": [
        "Uses bigcache for in-memory storage",
        "Cache TTL: 15 minutes",
        "Max cache size: 512MB",
        "Returns exist=false if cache miss (no error)",
        "No external service calls - pure in-memory operation"
      ],
      "implementation_details": {
        "cache_client": "bigcache.BigCache",
        "storage_type": "in-memory with sharding",
        "initialization": "serverless-global-service/app/regional_proxy/regional_proxy.go:25-40"
      }
    },
    "RegionalServerProxyService.Set": {
      "infrastructure": {},
      "services": [],
      "notes": [
        "Stores cluster info with cluster_id as cache key",
        "Serialization: protojson",
        "No external service calls - pure in-memory operation"
      ],
      "implementation_details": {
        "cache_client": "bigcache.BigCache",
        "operation": "cache.Set(id, data)",
        "implementation": "serverless-global-service/app/regional_proxy/regional_proxy.go:94-106"
      }
    },
    "RegionalServerProxyService.BatchSet": {
      "infrastructure": {},
      "services": [],
      "notes": [
        "Iterates through cluster list and calls Set for each",
        "Stops on first error",
        "No external service calls - pure in-memory operation"
      ],
      "implementation_details": {
        "cache_client": "bigcache.BigCache",
        "operation": "Loop: cache.Set(cluster_id, data)",
        "implementation": "serverless-global-service/app/regional_proxy/regional_proxy.go:126-140"
      }
    },
    "RegionalServerProxyService.Delete": {
      "infrastructure": {},
      "services": [],
      "notes": [
        "Removes single cluster from cache",
        "Returns ok=true even if key not found",
        "No external service calls - pure in-memory operation"
      ],
      "implementation_details": {
        "cache_client": "bigcache.BigCache",
        "operation": "cache.Delete(id)",
        "implementation": "serverless-global-service/app/regional_proxy/regional_proxy.go:80-92"
      }
    },
    "RegionalServerProxyService.DeleteAll": {
      "infrastructure": {},
      "services": [],
      "notes": [
        "Clears entire cache",
        "Used by caller (serverless-global-service) when cache inconsistency detected",
        "No external service calls - pure in-memory operation"
      ],
      "implementation_details": {
        "cache_client": "bigcache.BigCache",
        "operation": "cache.Reset()",
        "implementation": "serverless-global-service/app/regional_proxy/regional_proxy.go:142-154"
      }
    },
    "RegionalProxyLifecycle.Startup": {
      "infrastructure": {
        "bigcache": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "INIT CACHE",
              "trigger": "Create 15-minute in-memory cache for cluster info",
              "conditions": [
                "Always"
              ],
              "implementation": "regional_proxy.NewService() -> bigcache.NewBigCache(bigcache.DefaultConfig(15m))"
            }
          ]
        },
        "pprof": {
          "conditions": [
            "Always in serve mode"
          ],
          "operations": [
            {
              "operation": "REGISTER",
              "trigger": "Expose pprof handlers on the TiInf Gin engine",
              "conditions": [
                "Always"
              ],
              "implementation": "pprof.Register(inf.GinEngine())"
            }
          ]
        }
      },
      "services": []
    },
    "RegionalProxyLifecycle.BuildGRPCServer": {
      "infrastructure": {},
      "services": []
    }
  },
  "notes": [
    "Fresh codex rescan added explicit lifecycle coverage for the ephemeral bigcache-backed regional proxy runtime."
  ]
}
