Java – jersey post with a huge payload

javajsonrestserialization

I have a requirement to write a POST endpoint where the payload is huge(not normal). In the order 10s of Megabytes. And this endpoint will be accessed by a lot of clients (in the order of 1000s) simultaneously.

How should I go about designing this endpoint?

The expectation is to validate the incoming requests and send appropriate responses to the clients.
I understand that serializing the entire JSON into an object tree wont scale and I am looking for something like this.

Are there other options?

Best Answer

I don't know what kind of objects you are serializing, but generally speaking, a binary serialization, combined with something like LZ4 compression, makes much more sense than JSON.

Related Topic