AtoM의 계층구조 오류 발생시 참고사항(#1 Rebuild the nested set)

edited October 2015 in AtoM

Rebuild the nested set

AtoM generally uses a relational database to store its data (we recommend MySQL). However, relational databases, which are comprised of flat tables, are not particularly suited to handling hierarchical data. As developer Mike Hillyer notes, “Hierarchical data has a parent-child relationship that is not naturally represented in a relational database table.” One method of addressing this is to employ a “Nested set model” (Wikipedia). AtoM makes use of a nested set to manage hierarchical relationships, such as between parent and child terms and descriptions.
Sometimes, during operations that involve updates to large hierarchies, the nested set can become corrupted - especially if the server times out during an operation that reaches the execution limit settings. The following task will rebuild all nested sets in AtoM:

php symfony propel:build-nested-set

출처 : https://www.accesstomemory.org/ko/docs/2.2/admin-manual/maintenance/cli-tools/#rebuild-the-nested-set

위의 내용은 AtoM 개발사에서 제공하고 있는 기술 문서에서 발췌한 것입니다.간단히 요약하면 관계형 데이터베이스를 사용하고 있는 AtoM에서 대량의 계층을 업데이트 할 때 DB의 중첩된 세트(the nested set)에 오류가 생길 가능성이 있으므로 이를 복구하는 방법을 제시한 것입니다.
관계형 데이터베이스에는 Mysql, Oracle, MS SQL Server, IBM DB2, Informix 등이 있고 AtoM은 이 중 Mysql을 사용하고 있습니다.
AtoM은 관계형 데이터베이스에서 계층 구조의 표현을 위해 'Nested set model'을 사용해서 부모/자식과 같은 계층적 관계를 관리한다고 합니다.
'Nested set model'에 대한 설명은 아래의 주소에서 확인하실 수 있습니다.
http://en.wikipedia.org/wiki/Nested_set_model

위의 방법이 문제를 근본적으로 해결할 수 있을지는 모르겠습니다.
하지만 관리단에서 시스템과 DB의 최적화와 튜닝 작업을 주기적으로 시행해 주는 일은 매우 중요할 것으로 보입니다. 
AtoM 같은 시스템도 그렇고 DB도 그렇고 모두 인간이 만드는 만큼 완벽할 순 없으므로 그 한계점을 이해하고 받아들여야 할 것 같습니다.
데이터베이스의 근본 한계를 한번에 극복하는 것은 현단계에선 불가능하며 많은 시간이 필요합니다. 다만 그 한계를 조금씩 극복할 수 있는 꼼수, 대안, 개선점들을 찾아가는 노력은 계속 필요할 것으로 보입니다.
Sign In or Register to comment.