In the official FAQ of Memcached i read:
"All individual commands sent to memcached are absolutely atomic."
However this is still unclear to me when it comes to get_multi and set_multi. I'd like to know whether get_multi and set_multi are atomic in the following sense:
For example these situations should be impossible:
1)
{'a': 0, 'b': 0}set_multi({'a': 1, 'b': 1})get_multi(['a', 'b']) and receives {'a': 1, 'b': 0}2)
{'a': 0, 'b': 0}get_multi(['a', 'b']) and receives {'a': 0, 'b': 2}This question is just so important for my design, that I thought I'd better ask for confirmation.
As I read this section, get_multi issues multiple requests that run in parallel, the idea being that for large requests, get_multi allows the total amount of time to get all results to be reduced. I don't see any guarantee or mention that the independent requests, done together, are collectively atomic. The same rule likely applies to set_multi (i.e. the individual requests are atomic, but the collection of them is not).
There also appears to be no mention of transactions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With