Optimistic Locking clearly explained | Java | SQL | System Design

preview_player
Показать описание
This video dives into two powerful solutions in system design: optimistic and pessimistic locking using Java and SQL to explain.

🔒 Pessimistic Locking: The Safety Net: Learn how this approach prevents conflicts by locking resources, ensuring only one person edits at a time. But is it always the best choice? We'll discuss its drawbacks too.

🚀 Optimistic Locking: The Speed Demon: Discover the secret to boosting performance when conflicts are rare. We'll break down how version tracking and smart conflict resolution can keep your systems running smoothly.

💡 Real-World Examples: See optimistic and pessimistic locking in action with Java/JPA and SQL. We'll even show you how to handle those pesky conflicts like a pro!

FOLLOW ME ON:
▶️ Main Channel: /bytemonk

Timestamps -
00:00 - Introduction
00:46 - Version Tracking
00:57 - Check Before Update
01:42 - Optimistic Locking
02:48 - Optimistic Locking ( Java/JPA with SQL)
05:24 - Pessimistic Locking vs. Optimistic Locking

System Design Interview Basics Playlist:

AWS Certification:

#optimistic #pessimistic #locking
Рекомендации по теме
Комментарии
Автор

What is the difference between version and etag? Are they both optimistic locking?

harinimurali
Автор

Thank you for great video! Can I ask you a silly question? In your example, would using an atomic update (UPDATE ... SET count = count + 1) solve the issue? And what are its trade-off compared to the approach in the video?

HoàngTrần-tz
Автор

I don't understand why this is better than isolation.

Zmey
Автор

My favorite religion from my favorite Monk the doesn’t bite!
“He has’th no system, has’th no faith. He has’th optimism shall design and one shall design with his flock and bring forth in to this world “& to the digital world” a system. And the the Shire Monk of shred amongst he flock the knowledge of computational possibilities spreading the good word of system design “bits & bytes along with ones might, must hath thy system for design and he may ponder a bit too much tho ponder not the monk sayith to his disciples. Follow my word, letting your faith guild you on this journey ‘ideally in 1080p+’ as thy keys shall present to view or that is normally seen with faith & use’ith first, as thy keys hath been within reach as you sit in front of the window gazing upon it, Thou keys hath lie elbowed length all along. Now go my innocent child, as systems need’th so to you shall bless them in your design of thy systems!”
~From the Holiest of Holy book chapter 16 To Byte or Not to Bite: Chapter 6, line 3
Amen

Dr_Larken