I am using C client library(synchronous) and our OS is Ubuntu 18.04. Both client and server versions are latest builds. Let me explain my usecase
In our case a record has multiple bins and each bin is a simple integer counter. So every write in our application is of the form “incr bin1, bin7 for this record”, “incr bin9, bin11 for this record” etc… We are using the aerospike_key_operate() API and so far so good. All our data is in-memory and we never write to disk. We don’t use any event loops etc in our application.
Unfortunately, Now we have 2 data centers(DC) that are few milliseconds away and we’ve formed 2 cluters(can’t form 1 cluster since network latency is substantial) and we want that writes(increments on counters) on one DC should reflect on another as well, so that the counter value when fetched is “cumulative”. The way XDR is implemented in Aerospike, I can’t use that(active-active replication) as I want the counters to be “cumulative” and not “overwritten” i.e I want to replicate the exact queries rather than “overwrite” records.
So as a solution, I am thinking about creating 2 clients, 1 client connects to local cluster and another to remote cluster. Whenever I want to perform a write operation I do aerospike_key_operate() on local cluster(which is synchronous) BUT I want to do aerospike_key_operate() on remote cluster in ASYNC way i.e I don’t want to block for response(which would only indicate failure or sucess since I am only performing increments on multiple bins of a record and not reading any bin)…i.e I want to use aerospike_key_operate() API in fire and forget way without waiting for response. Note that operations are only increments and no read is performed during these writes. I thought that aerospike_key_operate_async() would help me, but a sample program written using that and called using aerospike_key_operate_async(&client, &err, NULL, &key, &ops, NULL, NULL, NULL, NULL)) != AEROSPIKE_OK) is crashing. Can you guys help me?
Regards kartik