3 ms·
FDB also supports some atomic operations that may decrease the number of roundtrips and remove conflicts: https://apple.github.io/foundationdb/api-python.html#
by spullara 4y ago
FDB also supports some atomic operations that may decrease the number of roundtrips and remove conflicts:
https://apple.github.io/foundationdb/api-python.html#api-python-transaction-atomic-operations https://apple.github.io/foundationdb/api-python.html#api-pyt...
That said, I still don't think that it is necessarily the perfect match for implementing some of the Redis data structures.
- atombender 4y agoI had completely forgotten about those built-in ones. Right, so some operations can be made fully atomic server-side, but there are still a bunch of ops (append, pubsub, set commands such as SADD, etc.) that would need round trips.
- spullara 4y agoSADD wouldn't need a round trip since it is idempotent. You would just do a blind set which doesn't even require a transaction in FDB. Likewise, most of the other ones can be reframed / designed to not require round trips. I would still not use it as the backend unless I already had FDB in my solution and this was just an additional database type that I needed without ultimate performance as the constraint.
- atombender 4y agoSADD needs to return a value indicating whether the member was added or not, so I don't think you could avoid a round trip, since FDB doesn't have a "set if not exists".
- spullara 4y agoAh, I see. Bummer. Even if it had a set if not exists you would still need a transaction for it.