database lock

좀 더 쉽게 접근해보자. 

데이터베이스의 출발은 네트워크 환경에서 여러 사람이 동시에 작업을 할 경우 어떻게 일관성 있는 데이터를 읽고 쓸까에 대한 고민에서 시작한다.

읽고 쓰기에 대한 가장 기본적인 메카니즘은 락이며 ( mutex, locking 등의 용어 ) 락이라는 것은 

어떤 데이터를 작업할때 내가 작업을 시작한다고 어딘가 마킹하고 작업이 끝나면 마킹을 지우고, 다른 대기자에게 작업을 알리는 것이다.

즉, 은행에서 대기 번호표를 뽑는 것과 같다. 순차적으로 일을 처리하고 한 번에 한건만 하게 되는 것.

이것을 이후에 나올 isolation model에서 serializable이라고 한다. 

 

 

 

 

en.wikipedia.org/wiki/Record_locking

 

Record locking - Wikipedia

Record locking is the technique of preventing simultaneous access to data in a database, to prevent inconsistent results. The classic example is demonstrated by two bank clerks attempting to update the same bank account for two different transactions. Cler

en.wikipedia.org

 

Isolation level

 

 

 

+ Recent posts