awslabs/dynamodb-cross-region-library

[Feature Request / Enhancement] Traffic Compression to save money

scampuza opened this issue · 1 comments

Hey AWS Labs guys. You've done a terrific job with this utility for replicating DynamoDB tables across several regions. We've been using it for quite some time and it works just fine. Our DynamoDB tables are so huge and they are constantly changing, so the traffic generated by the tool to keep the tables replicated is huge as well, we are talking about several TBs monthly, which is leaving its mark on the AWS bill.

It would be nice to be able to enable some sort of compression on the traffic received/sent from/to DynamoDB, so we would be able to save a lot of money.

I'd appreciate any feedback/comments on this request.

Thanks a lot

DynamoDB supports GZIP compression for the response payload. By default this is off in the Java SDK. When enabled, a client header is sent with the HTTP request to DynamoDB saying the client will accept a GZIP'd response. DynamoDB will only GZIP its response to your client if it's above a certain size - if my memory is correct this is 4KB - and your client has the accept encodings gzip header.

LOC where the client is made:

private static final AtomicReference<AmazonDynamoDBAsync> DYNAMODB = new AtomicReference<AmazonDynamoDBAsync>();

Would you like to fork this repo and test out the GZIP compression? I think we use the default client configuration when we create AmazonDynamoDBASync, so you'll need to make a client config and then update the tests.

This might save you a few hundred dollars per month in DTO (data transfer out).