Where The Window Is
A team is moving off dual writes. Their first attempt:
def place_order(order):
with db.transaction():
db.execute("INSERT INTO orders (id, customer_id, total) VALUES (%s,%s,%s)", ...)
# (1)
with db.transaction():
db.execute(
"INSERT INTO outbox (id, aggregatetype, aggregateid, type, payload)"
" VALUES (%s,'Order',%s,'OrderCreated',%s)", ...)
# (2)
A separate log connector tails outbox and publishes each row to a topic. The process can be killed at (1) or (2). Which change removes the failure window, and why is the alternative worse?
Sign in to answer questions and track your progress
Sign In