aws-samples / lambda-refarch-mobilebackend

Serverless Reference Architecture for creating a Mobile Backend
Apache License 2.0
587 stars 113 forks source link

Doubt on "scalability" of this architecture #17

Open akuzni2 opened 5 years ago

akuzni2 commented 5 years ago

The Architecture diagram states

Mobile applications require a highly scalable backend infrastructure to support the variable usage created by mobile users. AWS Lambda runs code in response to requests and automatically manages and scales the underlying resources. Lambda Function 1 provides a synchronous endpoint for users to store and retrieve unstructured data from Amazon DynamoDB.

My doubt is the statement that this supports a "highly scalable backend". Since the API requests are served from Lambda functions which are inherently limited to 1000 concurrent connections by default. To support even 10K users using an app you would need a minimum of 10K Lambda sessions. Since this serverless architecture does not support connection pooling, many DBs will not support this amount of concurrent "clients". So my question is how is this "highly scalable"?

jasoncoffman commented 4 years ago

@akuzni2 The limit of 10,000 concurrent session is the default setting for accounts at creation. This limit is on a per region basis, and can be increased by raising a support ticket. You can find more information on the AWS Lambda limits here, as well as a link to the Support Center console.

roryj commented 4 years ago

@akuzni2 as @jasoncoffman said, these are limits that can be increased pretty easily by opening a support ticket. The other important thing to remember here is that concurrency != rps (requests per second). To hit your 1000 concurrent limit not only would you have to have all 1000 users make a request to your backend within the same second, but if you have a function that lasts sub 1 second (a CRUD api retrieving from a datastore can be sub 10ms), then all those users have to make requests within the same fraction of a second. Now of course, this is possible, especially as your customer base grows. In which that case we can increase your limit :).