AWS: API (Lambda), Dynamo, and Frontend Applications

NodeJS LAMBDA queries DYNAMO, call URL function from a PHP frontend, CLOUDWATCH chart monitor performance and security

DynamoDB Non-relational Database Structure

What you’ll learn

  • Create Dynamo table, mass insert of records with PYTHON script and Dynamo index definition..
  • Undestand the interface of Lambda function with PHP frontend and Dynamo table..
  • Permissions to Lambda function to access Dynamo tables..
  • Basic knowledge of cybersecurity and performance reading using Lambda and Dynamo cloudwatch charts..

Course Content

  • Introduction –> 1 lecture • 7min.
  • Structure of the Lambda, Dynamo and PHP frontend –> 1 lecture • 14min.
  • Create dynamo table, insert records with python script and INDEX definition –> 3 lectures • 11min.
  • Lambda funtion explained, create URL for PHP Frontend call and DYNAMO permission –> 3 lectures • 30min.
  • Review the performance of Lambda function and Dynamo table –> 1 lecture • 13min.

AWS: API (Lambda), Dynamo, and Frontend Applications

Requirements

  • DynamoDB Non-relational Database Structure

The DynamoDB database is a non-relational, schema-less database that uses partition and sort keys to optimize queries. In this implementation, fields such as Field02 and Field04 are used as the partition and sort keys, respectively, to create an efficient index for data retrieval. This allows structured querying while maintaining flexibility in the schema.

  • Lambda Function Using Node.js

The AWS Lambda function is written in Node.js and is designed to asynchronously handle API calls. It receives parameters from the frontend, parses them from the request body, and performs queries using a GSI (Global Secondary Index) on the DynamoDB table. The function uses structured key conditions and error handling to manage missing or malformed data inputs.

  • Exposing Lambda as an API with Function URL

The Lambda function is made accessible as a RESTful API using the ‘Function URL’ feature in AWS. This enables external systems, such as frontend applications, to make HTTP requests directly to the function, simplifying API integration.

  • Frontend PHP Integration with Lambda API

The frontend PHP application sends HTTP POST requests to the Lambda function using cURL. It captures user input (channel, start date, end date), encodes it into JSON, and transmits it via the configured Lambda URL. This enables dynamic querying of the DynamoDB database through a web interface.

  • Monitoring with AWS CloudWatch

AWS CloudWatch is used to monitor performance and detect potential security issues across the application stack, including the database, Lambda functions, and frontend access patterns. Logs provide visibility into execution times, errors, and anomalies for ongoing optimization and security auditing.

Get Tutorial