Transaction 併發錯誤與隔離層級

Image for post
Image for post

髒讀 Dirty Read

一個事務在處理過程中讀取了另外一個事務未提交的數據。

Image for post
Image for post

不可重複讀 Non-repeatable read

一個 Transaction範圍內,多次查詢某個數據,卻得到不同的結果。

Image for post
Image for post

幻讀 Phantom Read

Image for post
Image for post

解決併發事務一致性難題:隔離層級

那不然…不要併發執行…序列化執行就沒事了…?

Image for post
Image for post

Read Uncommitted

Read Committed

Repeatable Read

Serializable

Deadlock 死結

Image for post
Image for post

小結

Written by

Software Engineer (https://github.com/kylemocode)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store