0 votes
in AWS by

An organization deployed their static website on Amazon S3. Now, the Developer has a requirement to serve dynamic content using a serverless solution.

Which combination of services should be used to implement a serverless application for the dynamic content? Select 2 answers from the options given below.

1 Answer

0 votes
by

Answer - A and D.

Out of the above list, Given the scenario, API Gateway and AWS Lambda are the best two choices to build this serverless application.

The AWS Documentation mentions the following.

AWS Lambda lets you run code without provisioning or managing servers.

You pay only for the compute time you consume - there is no charge when your code is not running.

For more information on AWS Lambda, please refer to the below Link-

https://aws.amazon.com/lambda/

Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.

For more information on the API gateway, please refer to the below Link-

https://aws.amazon.com/api-gateway/

Option B is incorrect because EC2 is not a serverless offering.

To use serverless compute on Cloud, you can use Lambda.

Option C is incorrect because ECS is primarily used for hosting containers and serverless offering for the same solution is Fargate.

Option E is incorrect because Kinesis Data Streams is a scalable and durable real-time data streaming service that can continuously capture gigabytes of data per second from hundreds of thousands of sources.

It is not required in this scenario.

The organization has already deployed their static website on Amazon S3, which is a highly scalable, reliable, and low-cost storage service. Now, the requirement is to serve dynamic content using a serverless solution. Therefore, two services that can be used to implement a serverless application for the dynamic content are:

  1. Amazon API Gateway
  2. AWS Lambda

Here's a detailed explanation of why these two services are suitable for the requirement:

  1. Amazon API Gateway: Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. It acts as a front door for applications to access data, business logic, or functionality from backend services, such as AWS Lambda. In this case, API Gateway can be used to expose Lambda functions that generate dynamic content as RESTful APIs. These APIs can be called from the static website hosted on S3 to fetch the required dynamic content.

  2. AWS Lambda: AWS Lambda is a serverless compute service that lets developers run code without provisioning or managing servers. It can be used to execute code in response to events, such as changes to data in Amazon S3, DynamoDB, or Kinesis. In this case, Lambda can be used to write functions that generate dynamic content based on certain input parameters or events. These functions can be called from the static website hosted on S3 using API Gateway.

Other options, such as Amazon EC2, AWS ECS, and Amazon Kinesis, are not suitable for this requirement because:

  1. Amazon EC2: Amazon EC2 is a web service that provides resizable compute capacity in the cloud. It requires developers to provision and manage virtual machines to run their applications. This approach is not serverless and adds overheads in terms of management and cost.

  2. AWS ECS: AWS ECS is a fully managed container orchestration service that lets developers run applications on a cluster of Amazon EC2 instances. It requires developers to package their application code and dependencies into containers and manage the underlying infrastructure. This approach is not serverless and adds overheads in terms of management and cost.

  3. Amazon Kinesis: Amazon Kinesis is a fully managed service that makes it easy to collect, process, and analyze real-time streaming data at any scale. It is suitable for use cases where data needs to be processed in real-time, such as IoT devices or social media feeds. However, it is not suitable for serving dynamic content on a static website hosted on S3, as it is not designed for that purpose.

...