AWS Serverless Environment setup with API Gateway, Lambda and Aurora

112 Views Asked by At

Its a kind of GYM fitness IoT/Serverless project.

Work Flow

Each Member is wearing a fitness band on hands and it sends the data to the fitness mobile app every 30min via Bluetooth. Every day(7 am to 8 am) or when the user connects the mobile app to the internet, it will execute a Json call on the mobile app backend and send data to AWS API gateway, with the help of Lambda we will write the data to AWS Aurora. After that, each member can able to see the daily workout details in their fitness app.

Need to setup an AWS serverless environment to handle n number of requests to the API Gateway. I've some doubts about setup the serverless environment

Questions:

  1. How to handle a large number of queries comes to API Gateway (more than 10000/sec)
  2. Did the lambda can handle the request? How to handle the data write to DB?
  3. What kind of AWS Aurora is Suitable to handle the request.

Looking at your valuable suggestion to implement with highly scalable infrastructure.

1

There are 1 best solutions below

2
On

How to handle a large number of queries comes to API Gateway (more than 10000/sec)

API GW has limit of 10k requests/s with burstable capacity. This is a lot, so are you sure do you really need so much?

You may use SQS or Kinesis for handling much higher throughput. (each option would have its pros and cons)

Did the lambda can handle the request? How to handle the data write to DB?

The default concurrency limit for lambda is 1000 (increasable on request) , however using SQS or Kinesis could help to "smooth" the peaks and allow using more reasonable infrastructure.

What kind of AWS Aurora is Suitable to handle the request.

As soon as you're using queueing of write events, you could select your instance types based on total throughput rather than be afraid of the peaks.