4

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?

brut3f0rc3
  • 1,173
  • 4
  • 13
  • 19
  • This shouldn't have been closed. Note that total item length in DynamoDB is 400kb. You don't need to serialise an item to string as there is a Binary type which stores bytes directly (plus an assumed 1-3 bytes length). So you could stash something close to 400kb in DDB or much larger items in S3. – Andy Dent Aug 27 '20 at 07:33

0 Answers0