All challenges
Code AnalysisBeginner 60s

Read replica lag on user update

A user updates their name then reloads. They see the old name. What causes it?
Starter code
def update_name(uid, name):
    leader.execute("UPDATE users SET name=? WHERE id=?", name, uid)
def get_user(uid):
    return replica.query("SELECT * FROM users WHERE id=?", 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