johnlpage / POCDriver

Workload Driver for MongoDB in Java
Other
204 stars 87 forks source link

Add K and I operations #54

Closed imthereddwarf closed 1 year ago

imthereddwarf commented 1 year ago

Add two new operations for a -v pipeline K generate key value without query, I perform a $inc operation

johnlpage commented 1 year ago

What's the benefit/use case for these?

imthereddwarf commented 1 year ago

For testing an iot scenario, usage data arrives and is accumulated for the month. Whether $inc versus $set makes much difference is debatable, but an atomic update rather than a fetch and then update is significant. In the specific scenario I am investigating each device will perform three updates in a group so I am testing KIIII.

In my first round of testing KI was 10% faster than ku.

Pete On Sat, Dec 31, 2022 at 5:40 AM John Page @.***> wrote:

What's the benefit/use case for these?

— Reply to this email directly, view it on GitHub https://github.com/johnlpage/POCDriver/pull/54#issuecomment-1368217074, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADFE72QBHCGL4ETTWCMUYFDWQAZUDANCNFSM6AAAAAATNHY36E . You are receiving this because you authored the thread.Message ID: @.***>

johnlpage commented 1 year ago

I should start by saying that's for working on this, I don't normally debate PR's but I'm trying to keep POCDriver as focussed as possible. I absolutely get the Update without previous fetch idea, although that's not how I envisioned these workflow options if you need to simulate an update then other steps it makes sense.

I think the increment option is much less valid, an update is an update generally has to read and write the whole document to cache anyway and it opens up people wanting to make this a general purpose simulator which it's not. Is there a difference between Ku and Ki ?

johnlpage commented 1 year ago

Also KIII ? - you might want to reach out directly but if the update/I isn't retrieving the document in between (i.e. not using findOneAndUpdate which I don't think -v will do) what's the business logic to three distinct updates to the same document without reading it between and can they be combined. A lot of older uncombinable ops like $push/$pull have workarounds now.