New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't differentiate between read and write in ConsumedCapacity #112
Comments
I didn't "opt to throw away" the read and write data. It didn't exist as part of the API when this was implemented. It's obvious if you glance at the old Capacity or ConsumedCapacity structs. It looks like read and write data was added when transactions were implemented. Anyway, this change unfortunately puts us in an awkward position. I don't want to add breaking changes just yet, but I'll take a note of this for potential 2.0 changes. In the meantime, I'll add some fields to ConsumedCapacity with the read/write data. Believe it or not, this library has been stable for longer than the official SDK. Many changes and additions to the DynamoDB API have happened since then. I would appreciate if you took that into consideration before assuming that I am throwing away your data for no reason. |
I released v1.6.0 which adds fields to ConsumedCapacity for the indexes and the table read/write info. It's not ideal having a separate map for reads and writes but it's the best we can do until v2.0. |
Thanks much for that. I’m sorry for assuming the worst when I didn’t have all the context. That’s strange to hear that the API only returns totals. I also can’t find documentation about that, plus I’m finding some actually inaccurate gems like this: I think I’ll ask our AWS rep today for more details and see if they can clarify that in the documentation. Thanks for bringing that to our attention. Thanks for the quick turnaround, and apologies again for being rude. |
The documentation is still mostly unclear, but I think things are coming together. I don't think there are actually any DynamoDB operations (besides transactions!) that consume both RCU and WCU. For example, take a look at these sections, which list the operations that consume RCU and the operations that consume WCU. See also the ReturnValues parameter of UpdateItem, which states that no matter what data you choose to return, no RCU will be consumed. I think the most likely explanation now (which I will confirm with our AWS rep) is that the |
I confirmed with AWS support that there are no operations that consume both RCU and WCU (besides transactions, as you noted). |
That makes a lot of sense, thanks! I'll improve the godoc for these later. |
The ConsumedCapacity type in guregu is basically the same as the ConsumedCapacity type in the AWS SDK (but "with less pointers"), except that where the
Table
,GlobalSecondaryIndexes
, andLocalSecondaryIndexes
fields in the AWS SDK further break down reads and writes......guregu has opted to throw away the read/write breakdown and just report the total (corresponding to
CapacityUnits
above):This makes it impossible to accurately break down consumed capacity for complex queries, and for no reason I can discern. If the goal is to have fewer pointers, you can still have a
Capacity
struct that breaks down read and write according to the information returned by Dynamo.I can see a couple ways forward to fix this:
ConsumedCapacity
type to include all three pieces of information present in the AWS response. This would unfortunately have to be a breaking change, or would require new fields to be introduced.ConsumedCapacity
type, pointers and all. This would not be breaking.The text was updated successfully, but these errors were encountered: