DynamoDb truncating attribute value upto certain length

0

Hi AWS experts, I have a use case where I am trying to insert a large xml string as an attribute value to an item. I do see that the value is getting truncated to 32604 characters after saving it. I do know that an item max size can be 400KB which includes sum of all attribute names and attribute values and this is inclusive of the same item which is projected in LSI of that DynamoDB table. My question is this what is expected if we try to insert large String in an item ? Is my assumption correct ?

질문됨 일 년 전295회 조회
2개 답변
1

You can have string values in excess of 32kb in DynamoDB. I wouldn't want to do it frequently, but it's allowed.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html says: "The length of a String is constrained by the maximum item size of 400 KB."

My guess is something else in your stack is truncating the string if you're seeing truncation. It's not DynamoDB itself.

AWS
답변함 일 년 전
-1
수락된 답변

Yes your assumption is likely to be correct if the item's other attributes add up to take it over 400Kb.

Note DynamoDB is intended as on OLTP DB supporting large amounts of small operations. If you have a large piece of data associated with your record it might not be best to store that directly in your database. You'll clog up the RAM and churn your disk I/O as you read and write that blob, and may get expensive. Put the blob in S3 instead. Your database record can include a pointer to the object in S3, and you can load it out when it's needed. S3 has a better pricing model for reading and writing large blobs of data, and it won't put extra strain on your database.

전문가
답변함 일 년 전
  • Yes thanks for confirming.. This is exactly what I was also thinking as an alternative.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠