I have a use case where in I would want to either upload an object to S3 and store its key against the id, or store the entire object in dynamoDb depending upon its size.
I need a way to figure out a way to find out the size of the object. Since I will be storing it in the form of a blob, I could serialize it, and calculate the length of the string (dyanamoDb stores strings in UTF-8, so the length will equal the number of bytes), or I could try the Instrumentation interface.
Is there a preferred way for doing this?