A safer approach to dual writes | Architectural Simplification
2024-03-18
Description
Cockroach Labs Technical Evangelist Rob Reid looks at the dual write problem, specifically relating to queue coherence and queue incoherence in the latest installment in our Architectural Simplification series. Join Rob as he demonstrates: ✔️ A comparison of a stock system writing to a system of record database and a queue performing two writes against a service writing to a system of record publishing transactionally consistent messages to the queue ✔️ How his Before and After architectures compare in a variety of scenarios ✔️ Why harnessing CDC in CockroachDB and achieving the transactional outbox pattern is a safer approach to dual-writes. A safer approach to dual writes | Architectural Simplification 00:00 Introduction 00:15 Before and after diagrams 00:56 Comparing before and after code 02:31 Testing the before scenario 03:32 What happens during an error between the database write and the queue write? 04:52 Testing the after scenario 06:27 Closing notes Additional resources ✔️ What is CockroachDB? https://cockroa.ch/42uaZ9G ✔️ CockroachDB architecture overview: https://cockroa.ch/3RzIvrh ✔️ Message queuing and the database: Solving the dual write problem: https://cockroa.ch/43iPQ2J ✔️ CDC in CockroachDB: https://cockroa.ch/48SNFE7 ✔️ Transactional outbox pattern: https://cockroa.ch/4a8SCd6 #distributedsql #softwarearchitecture #softwaredesign