EPISODE · Jul 29, 2026 · 6 MIN
Why Database Upsert Needs Merge Not Separate Insert or Update
from Database Tech with Fexingo: SQL, NoSQL, and Data Storage Conversations · host Fexingo
When building a user profile service, you often need to insert a new record or update an existing one atomically. Using separate INSERT and UPDATE statements under high concurrency creates race conditions and potential data corruption. This episode explores why modern databases offer upsert operations—PostgreSQL's ON CONFLICT, MySQL's ON DUPLICATE KEY, and SQLite's INSERT OR REPLACE—to guarantee atomicity. We discuss how these MERGE-like constructs handle conflict detection differently, the locking trade-offs, and why relying on application-level retry logic is error-prone. With a real-world example of an inventory system, we show the performance impact of choosing the right upsert strategy. By the end, you'll understand why legacy two-step patterns can fail in production and how to adopt safer, database-native merge semantics. #DatabaseTechWithFexingo #Technology #Databases #Upsert #Merge #Concurrency #SQL #NoSQL #DataStorage #PostgreSQL #MySQL #SQLite #Atomicity #RaceCondition #Transaction #FexingoBusiness #BusinessPodcast #DatabasePerformance Keep every episode free: buymeacoffee.com/fexingo
Embed this episode
Ready to play
Why Database Upsert Needs Merge Not Separate Insert or Update
No transcript for this episode yet
Similar Episodes
No similar episodes found.
Similar Podcasts
No similar podcasts found.