0
votes

Is there a way to make documentdb return compressed responses / gzip ?

Background

I need to return ~1800 documents as fast as possible. Right now a doc's size is about 5kb. This means that the query will return 8.8 MB.

Current speed is ~6.5 sec for the whole query, meaning 1.3 MB / sec. My whole query performance suffers from network latency. West-Europe where document db is hosted and results are expected in East Europe.

The query results has a huge compression rate. 8.8Mb would be gziped into 400 kb.

I also tried Azure Functions within the same data center query performance dropped to 5.5 sec so not that much.

1

1 Answers

0
votes

You could implement compression in a JavaScript stored procedure and use this to query and return data.

More on stored procedures can be found here: https://azure.microsoft.com/en-us/documentation/articles/documentdb-programming/#stored-procedures

DocumentDB does not have native support for compressed responses.