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.

posta 2 anni fa2236 visualizzazioni
2 Risposte
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
ESPERTO
con risposta 2 anni fa
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
ESPERTO
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande