{
  "service": {
    "name": "atlas-kv",
    "environment": "production",
    "version": "2.8.4",
    "region": "us-east-1",
    "clusterId": "kv-prod-use1-042"
  },
  "network": {
    "listenAddress": "0.0.0.0",
    "clientPort": 7379,
    "peerPort": 7380,
    "tls": {
      "enabled": true,
      "minVersion": "TLSv1.3",
      "certificateFile": "/etc/atlas-kv/tls/server.crt",
      "privateKeyFile": "/etc/atlas-kv/tls/server.key",
      "clientCertificateRequired": true,
      "trustedCaFiles": [
        "/etc/atlas-kv/tls/ca-primary.crt",
        "/etc/atlas-kv/tls/ca-rotation.crt"
      ]
    }
  },
  "storage": {
    "engine": "lsm",
    "dataDirectory": "/var/lib/atlas-kv/data",
    "walDirectory": "/var/lib/atlas-kv/wal",
    "compression": {
      "enabled": true,
      "algorithm": "zstd",
      "level": 3
    },
    "compaction": {
      "strategy": "leveled",
      "maxConcurrentJobs": 4,
      "targetFileSizeMb": 128
    }
  },
  "replication": {
    "mode": "raft",
    "electionTimeoutMs": 1500,
    "heartbeatIntervalMs": 250,
    "snapshotIntervalSeconds": 900,
    "maxLogEntriesBeforeSnapshot": 50000,
    "members": [
      {
        "nodeId": "kv-prod-use1-a",
        "address": "10.24.8.11",
        "peerPort": 7380,
        "role": "voter",
        "zone": "us-east-1a"
      },
      {
        "nodeId": "kv-prod-use1-b",
        "address": "10.24.16.12",
        "peerPort": 7380,
        "role": "voter",
        "zone": "us-east-1b"
      },
      {
        "nodeId": "kv-prod-use1-c",
        "address": "10.24.32.13",
        "peerPort": 7380,
        "role": "voter",
        "zone": "us-east-1c"
      }
    ]
  },
  "sharding": {
    "enabled": true,
    "strategy": "consistent-hash",
    "virtualNodesPerMember": 256,
    "rebalance": {
      "enabled": true,
      "maxConcurrentMoves": 8,
      "throttleMbPerSecond": 64
    }
  },
  "api": {
    "requestTimeoutMs": 3000,
    "maxRequestBodyBytes": 1048576,
    "defaultConsistency": "quorum",
    "supportedOperations": [
      "get",
      "put",
      "delete",
      "compareAndSwap",
      "scan",
      "watch"
    ],
    "rateLimits": {
      "default": {
        "requestsPerSecond": 20000,
        "burst": 50000
      },
      "admin": {
        "requestsPerSecond": 1000,
        "burst": 2000
      }
    }
  },
  "observability": {
    "metrics": {
      "enabled": true,
      "endpoint": "/metrics",
      "histogramBucketsMs": [
        1,
        2,
        5,
        10,
        25,
        50,
        100,
        250,
        500,
        1000
      ]
    },
    "logging": {
      "level": "info",
      "format": "json",
      "sampledEvents": [
        "read_timeout",
        "raft_election",
        "shard_rebalance"
      ]
    },
    "tracing": {
      "enabled": true,
      "collectorUrl": "https://otel-collector.internal.example.com/v1/traces",
      "sampleRate": 0.05
    }
  },
  "security": {
    "authentication": {
      "type": "mutual_tls",
      "anonymousAccess": false
    },
    "authorization": {
      "enabled": true,
      "policies": [
        {
          "name": "app-read-write",
          "subjects": [
            "spiffe://example.com/service/cart-api",
            "spiffe://example.com/service/checkout-api"
          ],
          "keyPrefixes": [
            "cart/",
            "session/"
          ],
          "permissions": [
            "read",
            "write",
            "delete"
          ]
        },
        {
          "name": "analytics-read-only",
          "subjects": [
            "spiffe://example.com/service/reporting-worker"
          ],
          "keyPrefixes": [
            "events/",
            "session/"
          ],
          "permissions": [
            "read",
            "scan"
          ]
        }
      ]
    }
  },
  "backup": {
    "enabled": true,
    "schedule": "0 */6 * * *",
    "retentionDays": 14,
    "destination": {
      "type": "s3",
      "bucket": "atlas-kv-prod-backups",
      "prefix": "clusters/kv-prod-use1-042",
      "kmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/7d5a2d43-8c26-4a35-96f8-2c5c2d52c983"
    }
  },
  "health": {
    "startupGracePeriodSeconds": 60,
    "readiness": {
      "maxReplicationLagMs": 750,
      "minAvailableVoters": 2
    },
    "liveness": {
      "maxStorageStallSeconds": 30,
      "maxRaftHeartbeatDelayMs": 2000
    }
  }
}