Reputation: 4151
I want to design a banking system using couchbase , and I need high durability (like RDBMS) , How can I achieve 100% durability and not bit of data loss?
I know I can use persist_to
and replicate_to
for durability
bucket.insert(id, data, { "persist_to": 3}, (error, result) => {
if(error) {
throw error;
}
console.log(result);
});
1- If I have 6 servers and I choose persist_to=3
, How can I ensure that the data is durable , for instance If the active node is server1 and my data is persisted to server1, server2 and server3 , and we have a fail on server1 , What if server4 -that has no data in memory or disk- become active?
2- How can I detect from SDK the size of cluster dynamically?And set persist_to
to majority (numberOfNodes/2+1)
Upvotes: 4
Views: 101