Distributed protocols like 2PC and Paxos can be optimized for scalability through rule-driven query rewrites that preserve correctness.