4

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?

enter image description here

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)

WebMaster
  • 3,050
  • 4
  • 25
  • 77
  • There is a limit to the number of replicas that you can have total, and this is defined on the bucket configuration. The maximum is 3. The `persist_to`/`replicate_to` settings are client side checks that will *confirm* that the documents have been persisted/replicated, but it's Couchbase itself that is queuing the replication, not the client. – Matthew Groves Aug 21 '18 at 18:48
  • 1
    @MatthewGroves I know there is a max 3 limit for replicas , Assume this scenario **server1** is active(master) and **server2**, **server3**, **server4** is replica (slave) for my vBucket , If at the time I change data **server1** failed and changes is propagated to **server2**, **server3** but not **server4** what happends if **server4** become active(master) , Do I lost changes? as master (server4) dont accept data from slave (server2 and server3) – WebMaster Aug 22 '18 at 07:33

0 Answers0