Functional Requirements:
Fetch user data upon request from the website's visitor
Non-functional Requirements:
99.9% Uptime Availability
The system can handle up to 10,000 concurrent users without performance degradation
Response time to the request remains under 3 seconds
Order of Operations:
Presentation Layer:
Configure a static website on Amazon S3
Create a CloudFront distribution to integrate with the S3 bucket
Update the S3 policy to accept only our Cloudfront distribution
Logic Layer:
Configure a Lambda function to process requests from the website (i.e. return requested user data)
Create an API Gateway to receive the requests and pass them to AWS Lambda
Database Layer:
Create a DynamoDB table and populate it with user data
Integrate the Layers:
Allow Lambda to access our DynamoDB data
Integrate website and API Gateway
Validate the Application:
Test the functionality to ensure seamless connectivity across all layers
Presentation Layer
Leveraged Microsoft Copilot to generate simple web development files that I could embed into my bucket
Created an Amazon S3 bucket and uploaded the development files
Rather than selecting the public origin access, I opted to set the origin access as "Origin Access Control Settings" to ensure that only the CloudFront distribution would have access to the bucket's objects
Set the default root object to index.html to guide visitors to the homepage
Below, I updated my S3 bucket's policy to ensure that only my Cloudfront distribution can access my bucket and the objects inside. Once this was updated, I searched for my Cloudfront distribution URL on the internet to see if everything was working properly!
Looks like the bucket has been successfully connected to the distribution and is accessible via HTTPS!
Logic Layer
This Lambda function is designed to fetch user data from a DynamoDB table when a user enters their user ID on our website. Here’s how it works:
The Lambda function receives the user ID from the website via a query string parameter
It initializes a DynamoDB client and sets up the necessary parameters to look up the user data in the 'UserData' table
The function then sends a Get command to DynamoDB to retrieve the item associated with the user ID
Depending on whether the user data is found, it returns the appropriate HTTP response with either the data or an error message
Now that my function has been created, I'll head to API Gateway to integrate my function!
Steps for creating an API Gateway properly
Create my REST API
Configure a GET method connected to our lambda function
Enable CORS
Deploy the API
First, I created my UserRequestAPI
Next, I made sure to enable Cross Region Origin Sharing (CORS) to enhance the security and functionality of my API
After creating my GET method and connecting it to my 'RetrieveUserData' Lambda function, I deployed a production version of my new API
Database Layer
While creating my new DynamoDB table, I set the partition (primary) key to 'userID' so that our table queries our data based on userID, and will return all data related to the item with that ID
Here, I created basic test attributes to add to my DynamoDB table
Integrating the Layers
Now that each service has been configured, we need to weave everything I've created together to create a fully integrated web application!
Applying the principle of least privilege, I granted the RetrieveUserData Lambda function read-only access to the DynamoDB table. The function only needs to retrieve the data and does not require permission to add data or augment data
After this step, my logic layer should be fully integrated with my database layer. To validate this, I loaded up my invoke URL for my production stage API
Looks like my API is seamlessly able to query DynamoDB and pull data!
In order to integrate these two, I pointed the javascript front-end file to the API invoke URL, so that when the "Get User Data" button is pressed, the application knows which API to invoke
Validating the Application's Functionality
Each layer of the application has been woven together. The final step is to validate the application's functionality against our functional and non-functional requirements!
Happy to see that every layer has been connected seamlessly, and the functionality is working as intended flawlessly!
Recap
In this project, I built a robust and scalable three-tier web application using AWS resources, maintaining a serverless infrastructure.
Functional Requirements:
Fetch User Data
The system successfully catches the user request into the button on the landing page, triggering API Gateway to use a Lambda function to retrieve the appropriate data from DynamoDB and return it to the user.
Non-functional Requirements:
99.9% Uptime Availability:
Based on the Service Level Agreements (SLA) for the various services used in this project. Amazon projects a monthly uptime percentage of at least 99.95%, Eclipsing my availability requirement
Concurrent Users Handling:
Due to the serverless architecture, this system is designed to handle up to 10,000 simultaneous users without performance degradation.
Response Time:
Testing samples maintained a response time of just under 2 seconds, comfortably reaching my runtime requirement
Enhanced User Authentication:
Integrate multi-factor authentication (MFA) for added security
Services: AWS Cognito, AWS IAM
Advanced-Data Filtering and Analytics:
Provide users with more granular filtering options and integrate AWS QuickSight for advanced data visualization and reporting.
Services: AWS QuickSight, AWS Glue
User Experience Enhancements:
Improve the user interface (UI) with a modern design framework (e.g., React, Angular) and implement responsive design for usage across different devices.
Services: AWS Amplify, AWS CloudFront
5. Continuous Integration and Deployment (CI/CD):
Implement CI/CD pipelines using AWS CodePipeline and CodeDeploy for automated testing and deployment, ensuring easy updates and maintenance with minimal downtime.
Services: AWS CodePipeline, AWS CodeDeploy, AWS CodeBuild
6. User Feedback Integration:
Create a mechanism to collect user feedback and suggestions through surveys and feedback forms
Services: AWS SNS (Simple Notification Service), AWS SQS (Simple Queue Service)