Open haohetao opened 3 years ago
The idea is alright. The operation is usually called "upsert". Do you have time for a pull request with unit tests and implementation?
In contrast to the upsert operation in the relational database, HINCRBY is used and can only be used to accumulate integer value.
Ah. Alright. Then the name is OK.
What steps will reproduce the problem?
Every updateCounters() operation requires data to be query (determine whether the data exists) and locks to be used, which is very inefficient
What's expected?
Combine save and updateCounters in a single atomic operation to implement a lockless counter operation
What do you get instead?
Additional info