Vai al contenuto
TikMonkey

Scarica MP4Scarica video

Comment LOCK and I'll send you the cheat sheet comparing locks, atomic updates, and const… — @entrepreneurship93

Pubblicato 12 ott 2026 (più di due settimane fa)140 s1052 visualizzazioni

Statistiche del video

Conteggi pubblici dall’ultimo aggiornamento.

Visualizzazioni
1052
Like
16
Commenti
0
Condivisioni
2
Salvataggi
5
Interazione
1,71%
Durata
140 s
Pubblicato
12 ott 2026

Approfondimenti sul video

Il video TikTok «Comment LOCK and I'll send you the cheat sheet comparing locks, atomic updates, and constraints. One ticket left. Two people click Buy at the same time. Both your screens say you got it. ⚡ The bug isn't in your checkout code, it's the gap between checking and writing. Your server reads the seat, sees available, and then, before it writes sold, does something else entirely ⚡ In that gap Leo's request runs the exact same read. It also sees available. Then both writes land, and you send two confirmation emails for one chair ⚡ This is a race condition: not a rare crash, but the ordinary outcome of two requests arriving at once. Nothing threw. Nothing warned. The database did exactly what it was asked, twice ⚡ The first fix is pessimistic locking. SELECT ... FOR UPDATE takes a row lock, and Leo's request can't even read that row until Maya's transaction commits. The queue behind it stops being optional ⚡ The second fix is better because it removes the gap entirely: fold the check into the write. UPDATE seats SET status='sold' WHERE seat='F12' AND status='available', one statement, one decision ⚡ That runs as a single atomic operation. The check and the update either both succeed or neither happens. There is no "between" left for a second request to stand in Even buggy code can't break that rule, because the constraint lives in the database, not in your code. A unique key on the event-and-seat pair means two confirmed tickets for the same seat can't physically exist in the table. The engine refuses the second insert no matter what your application does. The database never really picks a winner by magic. It forces the two requests into a line. One goes first. The other sees the result. Two rules that outlive this specific example: keep your checks inside the write, and keep the final guarantee in the schema. Which has cost you more time, the bug or the incident review after it? Comment LOCK for the full cheat sheet. #databases #concurrency #postgresql #backend #programming» di @entrepreneurship93 ha totalizzato 1052 visualizzazioni, 16 like, 0 commenti, 2 condivisioni nelle metriche pubbliche rilevate da questo indice. Il tasso di interazione è pari a 1,71% (like, commenti e condivisioni rispetto alle visualizzazioni). È stato pubblicato più di due settimane fa e dura 2 minuti 20 secondi. È stato salvato 5 volte.

Dati aggiornati al 26 ott 2026 (UTC), dall’ultimo aggiornamento pubblico acquisito da questo indice.

Entrepreneur....

@entrepreneurship93

Vedi profilo
Follower
11.564
Seguiti
12
Like
646.906
Video
41

Video recenti

ALTRI VIDEO DI @ENTREPRENEURSHIP93

Hashtag in questo video

I link restano all’interno di questo indice.

Domande frequenti

Quante visualizzazioni ha questo video TikTok?
L’acquisizione indicizzata qui riporta 1052 visualizzazioni, 16 like e 0 commenti.
Chi ha pubblicato questo video TikTok?
È stato pubblicato da @entrepreneurship93, il cui profilo è collegato da questa pagina.
Qual è il tasso di interazione di questo video TikTok?
Sulla base delle metriche acquisite, il tasso di interazione è pari a 1,71% (like + commenti + condivisioni rispetto alle visualizzazioni).
Quando è stato pubblicato questo video TikTok?
È stato pubblicato il 2026-10-12, più di due settimane fa.
Quali hashtag vengono usati in questo video?
L’acquisizione collega 1 hashtag, a partire da #programming.
Quanto dura questo video TikTok?
La clip acquisita dura 2 minuti 20 secondi.