Chuyển tới nội dung
TikMonkey

Tải MP4Trình tải

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

Đăng ngày 12 thg 10, 2026 (hơn hai tuần trước)140 giây1.052 lượt xem

Xem thêm từ @entrepreneurship93

Thống kê video

Số liệu công khai từ lần làm mới gần nhất.

Lượt xem
1.052
Lượt thích
16
Bình luận
0
Lượt chia sẻ
2
Lượt lưu
5
Tương tác
1,71%
Thời lượng
140 giây
Ngày đăng
12 thg 10, 2026

Phân tích video

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” của @entrepreneurship93 có 1.052 lượt xem, 16 lượt thích, 0 bình luận, 2 lượt chia sẻ trong số liệu công khai mà chỉ mục này ghi nhận. Tỷ lệ tương tác tương ứng là 1,71% (lượt thích, bình luận và chia sẻ trên lượt xem). Video được đăng hơn hai tuần trước và có thời lượng 2 phút 20 giây. Video đã được lưu 5 lần.

Dữ liệu tính đến 26 thg 10, 2026 (UTC), từ lần làm mới công khai gần nhất mà chỉ mục này ghi nhận.

Entrepreneur....

@entrepreneurship93

Xem hồ sơ
Người theo dõi
11.564
Đang theo dõi
12
Lượt thích
646.906
Video
41

Video gần đây

XEM THÊM TỪ @ENTREPRENEURSHIP93

Hashtag trong video này

Các liên kết chỉ dẫn trong phạm vi chỉ mục này.

Câu hỏi thường gặp

Video TikTok này có bao nhiêu lượt xem?
Bản ghi được lập chỉ mục ở đây cho thấy 1.052 lượt xem, 16 lượt thích và 0 bình luận.
Ai đã đăng video TikTok này?
Video được đăng bởi @entrepreneurship93, có liên kết ngay trên trang này.
Tỷ lệ tương tác của video TikTok này là bao nhiêu?
Theo các số liệu đã ghi nhận, tỷ lệ tương tác là 1,71% (lượt thích + bình luận + chia sẻ trên lượt xem).
Video TikTok này được đăng khi nào?
Video được đăng vào 2026-10-12, hơn hai tuần trước.
Video này dùng những hashtag nào?
Bản ghi liên kết 1 hashtag, bắt đầu bằng #programming.
Video TikTok này dài bao lâu?
Đoạn video đã ghi nhận có thời lượng 2 phút 20 giây.