일관된 해싱

1 개요[ | ]

consistent hashing
일관된 해싱
  • 웹서버의 개수가 변동하는 가운데 요청을 분산하는 방법
  • 해시테이블의 크기가 변할 때, 평균적으로 K/n개의 키가 재매핑되면 된다.
  • 즉 노드나 슬롯의 개수가 바뀔 때, 노드의 추가나 삭제를 할 때, 전체 n개 노드 중 K개 항목만 다시 섞이면 되는 것이다.
  • 기존의 해싱에서는, 키와 슬롯간의 매핑이 모듈러 연산에 의해 정의되었기 때문에, 슬롯의 개수가 변화할 경우 거의 모든 키가 다시 재매핑되어야 했다.

Consistent Hashing Sample Illustration.png

2 복잡도[ | ]

노드(또는 슬롯) [math]\displaystyle{ N }[/math]개와 키 [math]\displaystyle{ K }[/math]개에 대한 점근적 시간 복잡도
전통적 해시 테이블 일관적 해싱
노드 1개 추가 [math]\displaystyle{ O(K) }[/math] [math]\displaystyle{ O(K/N + \log N) }[/math]
노드 1개 삭제 [math]\displaystyle{ O(K) }[/math] [math]\displaystyle{ O(K/N + \log N) }[/math]
키 1개 추가 [math]\displaystyle{ O(1) }[/math] [math]\displaystyle{ O(\log N) }[/math]
키 1개 삭제 [math]\displaystyle{ O(1) }[/math] [math]\displaystyle{ O(\log N) }[/math]

3 사례[ | ]

4 같이 보기[ | ]

5 참고[ | ]

  1. http://docs.openstack.org/developer/swift/ring.html
  2. DeCandia, G.; Hastorun, D.; Jampani, M.; Kakulapati, G.; Lakshman, A.; Pilchin, A.; Sivasubramanian, S.; Vosshall, P.; Vogels, W. (2007). “Dynamo: Amazon's Highly Available Key-Value Store”. 《Proceedings of the 21st ACM Symposium on Operating Systems Principles》. 
  3. http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf
  4. Lakshman, Avinash; Malik, Prashant (2010). “Cassandra: a decentralized structured storage system”. 《ACM SIGOPS Operating Systems Review》. 
  5. “Design -- Voldemort”. 《http://www.project-voldemort.com/》. 2015년 2월 9일에 확인함. Consistent hashing is a technique that avoids these problems, and we use it to compute the location of each key on the cluster.  |웹사이트=에 외부 링크가 있음 (도움말)
  6. Akka Routing
  7. “Riak Concepts”. 2015년 12월 22일에 원본 문서에서 보존된 문서. 2015년 12월 13일에 확인함. 
  8. http://www.gluster.org/2012/03/glusterfs-algorithms-distribution/
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}