How to insert bulk data (Key-Value pair) at once in C programming

Hi, I have created a client which inserting kay -value pairs one by one. Using following code,

fdb_transaction_set(tr, key1, (int)strlen(key1), val1, (int)strlen(val1));
fdb_transaction_set(tr, key2, (int)strlen(key2), val2, (int)strlen(val2));
FDBFuture *commitFuture = fdb_transaction_commit(tr);
fdb_future_block_until_ready(commitFuture);

Is there way to insert bulk data at once, instead of inserting one by one using C programming.

Are you concerned about overheads of individual set operations in the transaction, or is it something different?

In the above code, client keeps all key-value pairs in memory and sends them together in a single call to server when transaction commits.

2 Likes

There is no special API for bulk loading of data nor a more efficient way to write data than set() and commit(), but Best practices for bulk load has some advice on how to write a bulk loading client.

1 Like