Skip to main content

Answering in AWS -SQS

Revision History

Date

Version

Description

Author

Reviewer

Sep 02, 2024

1.0

Initial Version.

Krishnaa







Introduction

Objective

Create a poc to handle the millions of request in terms of leaner answering each blocks.

Scope of work

Rules:

 
  1. Create the poc and test the performance minimum 10,000 request in terms of learner answering each block in a given LE.

Reference

Document Title

Version No

Location

TOGAF

 10.0

 

AWS Documentation


Understanding SQS retries - AWS Lambda (amazon.com)



https://www.youtube.com/results?search_query=amazon+lambda+trigger+by+sqs



https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/example_sqs_Hello_section.html

Assumptions

  • BeED as the only contributor
  • Educators who creating experio.
  • Leaner who uses the experio.
  • BeED Public user who uses the experio.

Software Design Specification

Data Architecture


Causse of Issue

  1. SQL SERVER cannot be scaled horizontal.
  2. To accommodate million of request we have increase and decreases the server when ever there is expected spike in the connection which is directly proportional to cost involved.
  3. To avoid this scenario, we have two 
    1. Option 1 : Solution using QUEUE (SQS)
    2. Option 2 : Migrating the SQL SERVER to Babelfish and use Read and Write instance separately. ( Bit Costly in terms of implementation ).
Application Architect - Option 1


By introducing the Queue , we can server millions of request queued first in the SQS.

By introducing Lambda serverless short lived API from AWS to process the SQS and update the database in sequence. 

This would improve the user experience without compromising cost and Infrastructure.


Two Type of Request that we need to try 

  1. From client computer directly insert record into the SQS by this way we don't need Application Layer.
  2. Using Application Layer (C#) and Insert records in the SQS this would required Application layer to be involved.


Cost Estimation for SQS ( 1 Million Request and 1 TB Data Transfer)

image.png

Cost Estimation for SQS ( 10 Million Request and 2 TB Data Transfer)

image.png


Cost Estimation For Lambda (1-Million Request)   ( 1.8 RAM) 

image.png

Cost Estimation For Lambda (10-Million Request)

image.png


    Application Architect - Option 2

    Definitions & Acronyms

    • SDD – Software Design Document
    • S3 – Object Storage
    • HA – High availability

    Acceptance Criteria

    S.NO

    Acceptance Criteria

    Expected Result

    1.

    Must able to request 10,000 connections to SQS at any single point of time

    2.

    Lambda must able to process all the connection from SQS with our spiking the SQL server

    3.

    SQL server CPU should be less than equal to 85%

    4.

    SQL Server RAM usage should be less than equal to 85%
    5.

    6.

    7.

    8.