[Cloud] - Basic Power Calculator on AWS

Basic Power Calculator on AWS

Overview: The Basic Power Calculator app was deployed using AWS Amplify, providing a seamless integration for front-end hosting and backend service management.

Experiment referenced from this <tutorial>

Code in the Project can be found here

Architecture:

  1. AWS Amplify: Utilized for deploying and hosting the frontend of the application. Amplify simplifies the process of connecting the app to the backend services.
  2. API Gateway: Serves as the endpoint to trigger AWS Lambda functions. API Gateway handles the HTTP requests from the frontend and forwards them to the appropriate Lambda function for processing.
  3. AWS Lambda: Used for the core computation of the power calculator. This serverless compute service allows the calculator to execute the required computations in response to the API Gateway’s requests.
  4. DynamoDB: Integrated as the database to store unique results. Whenever a calculation is performed, the result is checked against DynamoDB to see if it already exists; if not, it is stored for future reference.
  5. IAM (Identity and Access Management): Ensures secure access and permissions management. IAM roles and policies are configured to allow the necessary permissions for the Lambda function to read/write from DynamoDB and for API Gateway to invoke the Lambda function.

Workflow:

  1. The user interacts with the Power Calculator app hosted on AWS Amplify.
  2. The app sends a request to the API Gateway.
  3. API Gateway forwards the request to the AWS Lambda function.
  4. The Lambda function performs the power calculation.
  5. The result is then stored in DynamoDB if it’s unique.
  6. The computed result is returned to the user through the API Gateway.

Benefits:

  • Scalability: Leveraging AWS Lambda and DynamoDB ensures that the application can scale automatically with demand.
  • Cost-efficiency: Using serverless architecture (Lambda and DynamoDB) reduces costs as you only pay for what you use.
  • Flexibility: AWS Amplify makes it easy to manage both the frontend and backend, facilitating rapid development and deployment.

©2024 Chantelle Loh