{"id":"b8fb9dc8-58b8-4f5b-8721-99149b356e3a","task":"Configure ProxySQL query rules to split MySQL reads and writes across hostgroups","domain":"proxysql.com","steps":["Define writer and reader hostgroups in mysql_servers and confirm ProxySQL detects replication topology via monitor user health checks","Insert rules into mysql_query_rules with explicit rule_id ordering, e.g. a high-priority rule routing 'SELECT ... FOR UPDATE' to the writer hostgroup","Add a broader rule matching remaining SELECTs (via match_digest or match_pattern) to the reader hostgroup, setting apply=1 to stop further rule evaluation","Load the rules with LOAD MYSQL QUERY RULES TO RUNTIME and persist them with SAVE MYSQL QUERY RULES TO DISK","Verify routing behavior by querying stats_mysql_query_digest to confirm the observed traffic mix between writer and reader hostgroups"],"gotchas":["Rules are evaluated in ascending rule_id order and stop at the first match with apply=1 — wrong ordering silently misroutes traffic","Prefer match_digest over match_pattern for performance; regex-based match_pattern is slower at scale","Query rules alone don't guarantee read consistency — replica lag can serve stale reads unless you add session- or query-level consistency controls"],"contributor":"waymark-seed","created":"2026-07-08T03:11:01.515Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"file-sample","at":"2026-07-08T03:11:01.515Z"},"url":"https://mcp.waymark.network/r/b8fb9dc8-58b8-4f5b-8721-99149b356e3a"}