익명 사용자
로그인하지 않음
토론
기여
계정 만들기
로그인
IT 위키
검색
Primary Site Two-Phase Locking
편집하기
IT 위키
이름공간
문서
토론
더 보기
더 보기
문서 행위
읽기
편집
원본 편집
역사
경고:
로그인하지 않았습니다. 편집을 하면 IP 주소가 공개되게 됩니다.
로그인
하거나
계정을 생성하면
편집자가 사용자 이름으로 기록되고, 다른 장점도 있습니다.
스팸 방지 검사입니다. 이것을 입력하지
마세요
!
'''Primary Site Two-Phase Locking (2PL)''' is a variant of the Two-Phase Locking protocol used in distributed databases. In this approach, one node is designated as the primary site for each data item, and it coordinates the locking and transaction processing to ensure serializability across the system. ==Key Concepts== *'''Primary Site:''' A designated node that manages all lock requests for a specific data item. *'''Global Serializability:''' Ensures that all transactions across distributed nodes maintain a serializable schedule. *'''Coordination:''' The primary site acts as the single authority for granting or releasing locks, reducing complexity in lock management. ==How Primary Site 2PL Works== The Primary Site 2PL protocol operates as follows: #Each data item in the distributed database is assigned to a primary site. #Transactions request locks from the primary site of the data item they wish to access. #The primary site uses the Two-Phase Locking protocol: #*'''Growing Phase:''' Locks are granted to transactions but not released. #*'''Shrinking Phase:''' Locks are released, but no new locks are granted. #Once the primary site grants a lock, the transaction can proceed to access the data at any replica site. ==Advantages== *'''Centralized Coordination:''' Simplifies lock management by delegating responsibility to primary sites. *'''Ensures Consistency:''' By centralizing lock control, Primary Site 2PL ensures consistency across distributed transactions. *'''Scalability:''' Each primary site manages its own subset of data, reducing bottlenecks. ==Limitations== *'''Single Point of Failure:''' If a primary site fails, the data it manages becomes unavailable. *'''Communication Overhead:''' Lock requests and responses require network communication, increasing latency. *'''Limited Concurrency:''' Centralized lock management may limit the level of parallelism. ==Example of Primary Site 2PL== Consider a distributed database where: *Node 1 is the primary site for data item A. *Node 2 is the primary site for data item B. ===Scenario=== Transaction T1 and T2 execute as follows: {| class="wikitable" !Step!!Transaction T1!!Transaction T2!!Primary Site Action |- |1||BEGIN TRANSACTION||BEGIN TRANSACTION||Both transactions start. |- |2||READ(A)||-||T1 requests a shared lock for A from Node 1 (primary site for A). |- |3||-||WRITE(A)||T2 requests an exclusive lock for A from Node 1 but must wait as T1 holds a shared lock. |- |4||COMMIT||-||T1 releases the lock on A. |- |5||-||WRITE(A)||T2 acquires the exclusive lock on A and writes. |- |6||COMMIT||-||T2 releases the lock. |} ==Applications== Primary Site 2PL is used in distributed systems where: *'''Global Consistency:''' A strict guarantee of serializability is required. *'''Low Update Rates:''' Environments with fewer updates to data items to minimize contention. *'''Simplified Lock Management:''' Centralized control is beneficial for simpler coordination. ==Comparison with Other 2PL Variants== {| class="wikitable" !Feature!!Primary Site 2PL!!Centralized 2PL!!Distributed 2PL |- |Lock Management||Delegated to primary sites for each data item||Centralized at a single node||Fully distributed across all nodes |- |Fault Tolerance||Affected by primary site failure||Single point of failure||Higher fault tolerance |- |Communication Overhead||Moderate (lock requests to primary sites)||Low (single coordinator)||High (peer-to-peer communication) |- |Scalability||High (multiple primary sites)||Limited||High |} ==See Also== *[[Two-Phase Locking]] *[[Distributed Database]] *[[Concurrency Control]] *[[Deadlock Detection]] *[[Centralized 2PL]] *[[Distributed 2PL]] *[[Primary-Replica Architecture]] [[Category:Database]]
요약:
IT 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-비영리-동일조건변경허락 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는
IT 위키:저작권
문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요.
또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다.
저작권이 있는 내용을 허가 없이 저장하지 마세요!
취소
편집 도움말
(새 창에서 열림)
둘러보기
둘러보기
대문
최근 바뀜
광고
위키 도구
위키 도구
특수 문서 목록
문서 도구
문서 도구
사용자 문서 도구
더 보기
여기를 가리키는 문서
가리키는 글의 최근 바뀜
문서 정보
문서 기록