Find answers, ask questions, and connect with our
community around the world.

Home Forums AWS AWS Certified Solutions Architect Professional Question on SQS to reduce load Reply To: Question on SQS to reduce load

  • Jon-Bonso

    Administrator
    May 5, 2020 at 8:22 am

    Hi Varun,

    Thank you for posting your question. We always strive to make the options in our practice tests as tricky as possible to mimic the actual AWS exam. In this scenario, you also have to consider the WCU of the DynamoDB table to handle the load or to use on-demand capacity mode to save on cost (rather than the provisioned mode). Although DynamoDB is a fully managed service, you still have to do some fine-tuning in order to achieve maximum cost-effectiveness.

    For example, if your application has a high usage load and is sending 100 eventually consistent reads per second and 100 standard writes per second, that could translate to 50 RCU and 400 WCU. If you used the provisioned mode, that can add up to about $198. Of course, this price can be lowered down if you used Auto Scaling, but take note that Option 2 explicitly mentioned “Provisioned” capacity as you won’t be able to set the WCU using the On-Demand mode.

    Sample DynamoDB configuration screenshot:


    https://i.udemycdn.com/redactor/raw/2019-07-19_04-25-00-b5c2cc4bb46da4929fc3ab90a1f43aa6.png


    However, if you used SQS, you are only charged for $0.00000040 per request or $0.40 if you have 1 million requests. This will definitely help the application to scale out and avoid having 100+ parallel requests per second to DynamoDB, since the message/workload is queued up.

    Hence, I don’t think that adding an SQS queue will significantly raise the cost in comparison with setting the WCU of the DynamoDB table. Moreover, manually setting WCU is not enough, you should also set up the RCU as well which is actually left out in the other options:

    https://aws.amazon.com/sqs/pricing/

    It is true that you will write the same amount of data to DynamoDB table, however, SQS will queue up those hundreds of requests so these will not be sent at the same time. As you know, the RCU and WCU setting of your DynamoDB table largely depends on the number of requests your application sent to DynamoDB per second. So in the above example that I mentioned, if the item size id 4 KB and your application is sending 100 eventually consistent read requests, then the RCU needed would be 50. If there are 100 write requests, then the WCU needed is 400, which will bring in an estimated cost of $198 per month (if using provisioned-mode, which clearly what is mentioned in the option).

    However, if your application has a queue system, it can delay some of the requests from 100 to 50 (or even less) requests, which will also bring down the required WCU/RCU needed. Instead of that $198 per month, it can only be less than half or even lower than that. This is the justification behind this scenario.

    Let us know if you need further assistance. The Tutorials Dojo team is dedicated to help you pass your AWS exam on your first try!

    Regards,

    Jon Bonso @ Tutorials Dojo

    • This reply was modified 4 years, 1 month ago by  Jon-Bonso.