With Amazon SQS, you may ship and obtain messages between software program elements at any scale. It was one of many first AWS providers I used and as a Options Architect, I helped many purchasers make the most of asynchronous communications utilizing message queues. The truth is, Amazon SQS has been usually accessible since July 2006 and, beneath the hood, has all the time used the identical wire protocol primarily based on XML that we name AWS Question protocol.
As we speak, I’m pleased to announce that Amazon SQS now helps a JSON-based wire protocol for all APIs. The AWS JSON protocol avoids most of the shortcomings of AWS Question protocol.
AWS JSON is extra environment friendly than the earlier XML-based protocol and might cut back each latency and client-side CPU utilization when sending and receiving SQS messages. For instance, for a request that sends a easy “hey world” message, the response physique dimension utilizing the previous AWS Question protocol is about 400 bytes. The content material size of the identical SendMessage response utilizing the brand new AWS JSON protocol is lower than 1/three of the earlier dimension.
Utilizing the New JSON-Primarily based Protocol with Amazon SQS
That is the nicest a part of this launch! To profit from the AWS JSON protocol, you simply must replace the AWS SDK to the newest model. Whereas constructing this new functionality, the SQS crew was cautious in order that no code modifications are wanted to make use of the brand new JSON-based wire protocol.
For instance, we ran a benchmark utilizing the AWS SDK for Java to check the previous and new wire protocols. We anticipate comparable outcomes from the opposite AWS SDKs. Primarily based on AWS efficiency checks for a 5KB message payload, JSON protocol for Amazon SQS reduces end-to-end message processing latency by as much as 23 p.c and reduces software shopper aspect CPU and reminiscence utilization. These numbers rely upon the precise implementation and might differ from what you’ll see to your personal functions.
Availability and Pricing
Amazon SQS assist for the brand new JSON protocol is accessible at present in all AWS Areas the place SQS is obtainable. All usually accessible AWS SDKs now assist AWS JSON for SQS APIs. To get the advantages of this optimization, you simply must replace the AWS SDK to the newest model accessible.
There is no such thing as a change in pricing when utilizing the AWS JSON protocol. For extra data, see Amazon SQS pricing.
In the event you’re all in favour of extra particulars on how AWS protocols work, you may take a look at Smithy, the language we use at AWS for outlining providers and SDKs.
After virtually 17 years of being usually accessible, we’re enhancing and innovating round our oldest service. Only a few months again, we launched server-side encryption with Amazon SQS-managed encryption keys (SSE-SQS) by default for newly created queues, elevated the default quota for top throughput mode for FIFO queues, and introduced assist for attribute-based entry management (ABAC) utilizing queue tags. Extra just lately, Amazon SQS added new APIs to handle dead-letter queue (DLQ) redrive programmatically. At AWS, it’s all the time day 1!
Replace the AWS SDK to enhance CPU and reminiscence utilization and cut back latency when utilizing Amazon SQS.