Is it possible to use Protocol Buffers with DynamoDB.

0

Hi,

I an trying to use Protocol Buffers in AWS lambda to generate java class and data object. how can I use Protocol Buffers generated data to store in dynamo DB, so that I can reduce the data size.

질문됨 2년 전2235회 조회
2개 답변
2

Your question is a little vague, are you asking how to store the protobuf data in DynamoDB? You can store binary data in DynamoDB using the Binary Data Type listed here.

I've not used protobufs in Java, but I have in Node using the protobufjs NPM package. I am sure you can do likewise by adding a needed package to your pom file.

profile pictureAWS
전문가
답변함 2년 전
1

DynamoDB API only support JSON, hence to store binary data, that is your Protobuf encoded payload, you need to first convert it to Base64. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.LowLevelAPI.html#Programming.LowLevelAPI.Binary

The stored binary data occupies the raw byte length.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/CapacityUnitCalculations.html

You can also handle binary data in Java using the Document API. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/JavaDocumentAPIBinaryTypeExample.html

AWS
전문가
답변함 2년 전

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

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

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

관련 콘텐츠