TLDR: What is best way to horizontally scale “double CAS” (where key collision has very low probability) and we’re okay with losing last 10 minutes of transactions.
Longer:
This is related to my previous question Configure fdb to write to disk only once every 10 mins ; I’m writing this as a different question, as I’m attacking the problem from a different angle and providing more context.
All my transactions are of the form (k1, o1, n1, k2, o2, n2), they are all 32 bytes (so 32 * 6 = 192 bytes) total. The transaction to be executed is:
// atomically, as a single transaction
if data[k1] == o1 && data[k2] == o2 {
data[k1] = n1;
data[k2] = n2;
}
All the keys & values are all 32 bytes. This is basically a “double CAS”; we check two places, compare with old value, and if pass, write new values.
Hot keys are very rare but might occasionally happen. Look at all transactions (hopefully > 1M) that happened in last 2s. The number of keys involved in >= 2 transactions is < 100 (those transactions can individually choose to commit/fail, and I’m okay with it either way; some transactions failing is okay tradeoff for higher write throughput)
Similar to my previous problem, in the event of a crash, I’m okay with losing transactions, as long as we have the following guarantee: there is some time T0 where:
all transactions before T0 goes through
all transactions after T0 are ignored
T0 loses a most 10 minutes worth of data
My world is Markov-ian – given the present, I don’t care about the past.
Question:
- What is the optimal config for this (especially taking into account the “commit log” mentioned by @markus.pilman
- Is FoundationDB the right DB for this (millions of “double CAS”) workload, or should I be looking at something else ? [Other things I’m looking at are DynamoDB and ScyllaDB].
Thanks!
[All machines are in the same datacenter; likely on the same rack; I might even be able to guarantee there are at most 3 physical switches between the “fdb client” and the “fdb server”]