미분류

분산 데이터베이스 및 복제 설계

One of the most important elements of distributed database architecture is replication. In fact, it defines the database architecture. It determines whether or not the data is consistent / available.

Master / Slave

Writes are executed on master nodes, replicated to slave nodes. If consistency is required, reads are executed on master nodes. If it is not, reads are executed on master nodes and / or slave nodes.

What’s the problem?

Let’s assume a) there is one node per physical server and b) writes are replicated to two slaves.

The problem is… two-thirds of the nodes are passive, two-thirds of the nodes do not respond to write requests, may not respond to read requests. The problem is… there are three times the number of nodes needed to meet throughput / latency requirements.

Masterless

Writes are exectued multiple nodes. If consistency is required, reads are executed on multiple nodes.

What’s the problem?

Let’s assume a) there is one node per physical server and b) writes are replicated to two nodes.

The problem is… consistent reads / writes are executed on multiple nodes. It requires multiple requests, one from the client to the server and two from the server to two other servers. The node receiving the write request must send write requests to the other two nodes resulting in higher latency, less throughput.

Primary Owner

It’s the best of both: reads / writes are executed on the primary owner and replicated, and reads / writes are executed on every node. Like a master / slave design, consistency is maintained by executing reads / writes on the primary node. Like a masterless design, every node is a primary node.

One of these is a poor design. One of these is good design. One of these is a great design.

What do you think?

Discuss on Hacker News
Discuss on Reddit

이 기사 공유하기

작가

Shane K Johnson was the Director of Product Marketing at Couchbase. Prior to Couchbase, he occupied various roles in developing and evangelism with a background in Java and distributed systems. He has consulted with organizations in the financial, retail, telecommunications, and media industries to draft and implement architectures that relied on distributed systems for data and analysis.

댓글 남기기

카우치베이스 카펠라를 시작할 준비가 되셨나요?

개발 시작하기

NoSQL을 탐색하고, 리소스를 찾아보고, 튜토리얼을 시작하려면 개발자 포털을 확인하세요.

카펠라 프리 사용하기

단 몇 번의 클릭으로 카우치베이스(Couchbase)를 직접 체험해 보세요. Capella DBaaS는 시작하기 가장 쉽고 빠른 방법입니다.

연락해

Couchbase 제품군에 대해 더 알고 싶으신가요? 저희가 도와드리겠습니다.