All challenges
Code AnalysisIntermediate 60s

Write to a read replica

Writes sent to a replica fail or vanish. Root cause?
Starter code
# app config
primary_dsn = "db-primary:5432"
replica_dsn = "db-replica:5432"
conn = connect(random.choice([primary_dsn, replica_dsn]))
conn.execute("UPDATE users SET name=%s WHERE id=%s", (n, uid))

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle