Laravel solved race conditions

  Рет қаралды 16,230

Aaron Francis

Aaron Francis

Күн бұрын

Пікірлер: 67
@ahmad-murery
@ahmad-murery Жыл бұрын
I wish you can make more Laravel courses just like the MySql for developers series where you start with the basics but with good details. Thanks Aaron!
@bballantyne3
@bballantyne3 Жыл бұрын
Your presentation style is ideal for me. Thank you!!!
@alchemist_dk
@alchemist_dk Жыл бұрын
This channel is pure gold, thanks for all the info.
@SurprisingLee
@SurprisingLee 9 ай бұрын
Having written almost exactly this locking system to prevent a race condition on Laravel v9, for ecommerce checkout no less, I can appreciate the good design behind this.
@irvanicsmoke1132
@irvanicsmoke1132 Жыл бұрын
this is why i subbed for!! Your explanation is always easy to understand and the delivery is so enjoyable :D Would be great if you also explain concurrency control like optimistic vs. pessimistic locking. Thanks once again Aaron!
@aarondfrancis
@aarondfrancis Жыл бұрын
You mean database locking? I might cover that on the PlanetScale channel!
@JeremyAndersonBoise
@JeremyAndersonBoise Жыл бұрын
I have been using Laravel for a ten years or so, but not in-depth for the last two. I need to look at this, this looks like a great improvement, thanks for the tip-off!
@aarondfrancis
@aarondfrancis Жыл бұрын
Glad you liked it!
@FarazSamapoor
@FarazSamapoor Жыл бұрын
I'm just so happy that we have you on our side. You are a great teacher and visualizing the examples vastly improves the learning experience. Thank you, Aaron! As a side note, I think it would be great if you could clean up the IDE a bit, as it distracts the viewer from the main content. I think hiding the "Tool Window Bars" would be a great start. You can find the option to hide them under Settings => Appearance & Behavior => Appearance => Tool Windows. Or just hit the shift key twice and search for the "tool window bars".
@aarondfrancis
@aarondfrancis Жыл бұрын
Good idea! Thank you
@spicynoodle7419
@spicynoodle7419 Жыл бұрын
I've requested this topic a few times. Thanks for delivering ❤
@agussumawigena4565
@agussumawigena4565 Жыл бұрын
sifu, you are very talented at transferring knowledge
@kirayamato6128
@kirayamato6128 Жыл бұрын
love you Aaron! The way you explained really makes me easy to understand the laravel and mysql. kudos!
@davidharting3119
@davidharting3119 Жыл бұрын
Maybe it’s a common Laravel idiom but doing while(1) instead of while(true) has a very devil-may-care attitude to it. I must say it shivered my timbers.
@davidharting3119
@davidharting3119 Жыл бұрын
Clutching my pearls!
@Novica89
@Novica89 Жыл бұрын
Awesome video and explanation on how to use atomic locking :) Even though I've used them and know how they work, it was a nice overview and confirmation that I was using them properly :D
@demian.succs0
@demian.succs0 Жыл бұрын
I've seen your videos on the planet scale channel and didn't know you have yours own lol, thanks KZbin algorithm to take me to the right place
@GringoDotDev
@GringoDotDev Жыл бұрын
I don't have anything to say except that you make fantastic videos!
@aarondfrancis
@aarondfrancis Жыл бұрын
Well I'm glad you said that! That makes my day. Thank you
@Voltra_
@Voltra_ Жыл бұрын
You'd be surprised how many web developers don't know/understand that the web is a fundamentally distributed system and thus don't use any kind of synchronization primitives when they're required
@pookiepats
@pookiepats 5 ай бұрын
Reads like a poser
@Voltra_
@Voltra_ 4 ай бұрын
@@pookiepats try me biche 🦌
@asjidali5453
@asjidali5453 Жыл бұрын
Incredible!
@thegrumpydeveloper
@thegrumpydeveloper Жыл бұрын
Nice that this is built in
@etiennez0r846
@etiennez0r846 Жыл бұрын
wow what a clever way to solve locks by inserting a unique key lol never thought of that xD
@aarondfrancis
@aarondfrancis Жыл бұрын
Sneaky right
@alikaram98
@alikaram98 5 ай бұрын
So good
@asuramus
@asuramus Жыл бұрын
Whats the different between pessimistic locking and cache lock?
@ajzack983
@ajzack983 9 ай бұрын
does this relate to ShouldBeUnique interface of the laravel jobs ?
@MrNichuya
@MrNichuya Жыл бұрын
Great video!
@zinatziaee5000
@zinatziaee5000 Жыл бұрын
Thanks very good
@gfni
@gfni Жыл бұрын
Great video as per! Can this be used in a simple user request so only one user can do something at once.. lets say on checkout? or is this used primarily in worker/job based solutions?
@aarondfrancis
@aarondfrancis Жыл бұрын
It totally could, I suppose! You might need a little more scalable, robust strategy for that though. If you've got thousands of users fighting over a single lock, that's probably gonna create a pretty gnarly bottleneck. Something like this would be more useful for coordinating backed processes fighting for limited resources.
@norc
@norc Жыл бұрын
Does someone know if the octane cache driver is supported?
@aarondfrancis
@aarondfrancis Жыл бұрын
I'm not sure!
@pablorgto
@pablorgto Жыл бұрын
Please, make an video about the Drupal 10?? Thank you!!!
@aarondfrancis
@aarondfrancis Жыл бұрын
You don't have to comment the same thing on every video 🫠
@sezohessen7485
@sezohessen7485 6 ай бұрын
WOWWWWW
@Stoney_Eagle
@Stoney_Eagle Жыл бұрын
Did you just use tailwind in the terminal?!!!! Omg 😮😍🤩
@aarondfrancis
@aarondfrancis Жыл бұрын
Haha yup! 07:10 I mention Termwind!
@Stoney_Eagle
@Stoney_Eagle Жыл бұрын
@@aarondfrancis Yeah I could not believe my eyes, I had to verify this magic 😂
@aliffiansyahmaulana
@aliffiansyahmaulana Жыл бұрын
I think its similar to withoutOverlapping() in task scheduler
@TurkerTUNALI
@TurkerTUNALI Жыл бұрын
Php guys finally enters the enterprise area. Great feature by the way.
@aarondfrancis
@aarondfrancis Жыл бұрын
Haha, I guess?
@vsakthivel85
@vsakthivel85 Жыл бұрын
But this lock won’t works if we use file cache
@aarondfrancis
@aarondfrancis Жыл бұрын
Across multiple processes on the same server it will!
@vsakthivel85
@vsakthivel85 Жыл бұрын
Thanks
@lighty262
@lighty262 Жыл бұрын
Kinda similar to flock function in PHP
@aarondfrancis
@aarondfrancis Жыл бұрын
Does that communicate across processes? I'm not familiar with it
@lighty262
@lighty262 Жыл бұрын
@@aarondfrancis It uses file system lock/release instead of caching driver in your video, all php process will use flock function to check wether the file is lock or not, that's how they communicate.
@thegrumpydeveloper
@thegrumpydeveloper Жыл бұрын
Would be cool to make an equivalent in js with other db locks.
@aarondfrancis
@aarondfrancis Жыл бұрын
Yup that'd be really neat! Could be a Prisma or Drizzle plugin maybe
@SaiyanJin85
@SaiyanJin85 Жыл бұрын
we better stick with redis since it's really easy to share between completely different servers.
@aarondfrancis
@aarondfrancis Жыл бұрын
Agreed! Redis or db.
@brunocmesquita
@brunocmesquita Жыл бұрын
Hey man, great content. Would you be interested in making a video on your IDE and terminal configuration?
@aarondfrancis
@aarondfrancis Жыл бұрын
Potentially! Although I don't really customize my setup hardly at all. It's just pretty standard PHP storm
@thebirdhasbeencharged
@thebirdhasbeencharged Жыл бұрын
@@aarondfrancis Font and theme
@iWhacko
@iWhacko Жыл бұрын
how are database and file locks surprising? A database lock can be great when migrating data, so it's locked to prevent new data to be inserted. And file locks can be great if a file is still being written to, before reading it. or some other reason.
@aarondfrancis
@aarondfrancis Жыл бұрын
A database lock is not surprising! Using a plain ol' unique key as a shared application lock is surprising, and quite clever. You might enjoy some of my database videos at youtube.com/@planetscale.
@iWhacko
@iWhacko Жыл бұрын
@@aarondfrancis Maybe I'm misunderstanding the issue then. I come from a software engineering background. and worked with low-level hardware too. And using a Mutex (or semaphores) to lock stuff is not new, and can also be done with plain-text keys in most systems. so I must be too set into my mindset to miss a point here I think.
@aarondfrancis
@aarondfrancis Жыл бұрын
Some of the things you learned a long time ago, other people have not yet learned! And thus the wheel of time continually turns.
@labkitadev
@labkitadev Жыл бұрын
give a real example using job with atomic locks on race condition case like inserting data
@travelcouple-z1m
@travelcouple-z1m Жыл бұрын
This is like golang 😮
@vsakthivel85
@vsakthivel85 Жыл бұрын
But this lock won’t works if we use file cache
@aarondfrancis
@aarondfrancis Жыл бұрын
For multiple processes on the same server it will. Mentioned at the end
Customizing Laravel Pulse
21:42
Aaron Francis
Рет қаралды 10 М.
Free, fast, full text search: Laravel + Typesense
22:04
Aaron Francis
Рет қаралды 15 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
PHP is the future
34:27
Aaron Francis
Рет қаралды 185 М.
What's New in Laravel 10 - The New Process Facade
12:03
Laracasts
Рет қаралды 14 М.
You don't need NoSQL (use MySQL)
31:26
PlanetScale
Рет қаралды 76 М.
I Reviewed Your Beginner React Code
12:36
Josh tried coding
Рет қаралды 101 М.
Laravel + Livewire todo app (and so much more)
16:41
Aaron Francis
Рет қаралды 55 М.
Laravel Dusk: painless browser automation
20:49
Aaron Francis
Рет қаралды 25 М.
How to scale Laravel: beyond the basics (Advanced Laravel Scaling)
9:04
Sabatino Develops
Рет қаралды 18 М.
Laravel Horizon: queue monitoring + configuration
14:54
Aaron Francis
Рет қаралды 24 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН