On ElasticCache, a redis cluster has one primary master read/write node and several secondary slave read-only nodes. The redis cluster periodically switches roles for nodes, exchanging master and slave nodes. The connection string to the ElasticCache is to the primary node when writes are needed. The createClient should be modified to take more than one connection port and host pair, and try each one in turn when an error like "Can't save packet:Error: READONLY You can't write against a read only slave." occurs so that the client can recover if the primary is switched while in operation.