0% found this document useful (0 votes)
5 views2 pages

AWS Architecture for Python & React App

Uploaded by

cnpant18
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

AWS Architecture for Python & React App

Uploaded by

cnpant18
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Background:

A start-up company wants to host its Python and React-based application (Backend: Python
API and Frontend React) using AWS. But they are not familiar with the AWS cloud platform.
They want to ensure that the application is secure, scalable, highly available, and cost-
efficient. As a solutions architect, you have to design a proper solution to meet their below
requirements.

Goal:
To architect a solution that is secure, scalable, highly available, and cost-effective using
AWS.

Requirements:

➢ They are concerned about the security of the application, so they have decided to
isolate their network from the rest of the customers virtually. Set-up a secure virtual
network where the only frontend of application is accessible by users and not the
database
➢ Execute the React application code using AWS Elastic Beanstalk. Ensure that the
source code of Web application is automatically picked, pushed to the master
branch, and deployed on the servers

➢ Ensure all the UI images served to the frontend application code are provisioned via
a secure storage unit

➢ There should be enough backups for both the Web and Database server, so if the
set-up crashes, we can launch a new one from the disaster recovery backups

➢ They are uncertain about the traffic pattern that how low or high it can be, so they
want the Web application to be running on at least two EC2 instances all time, and
when there is a high load, they must burst up to four instances in total

➢ The Web application should be highly available, even if any VM fails to respond to
queries, there should be a mechanism to switch the connection to another healthy
VM automatically

➢ Automate the download all the activity logs into a CSV file, create a stream of data,
analyze it, and display it via a dashboard

➢ The Web application should also be cached globally, so users worldwide can access it
with low latency
Deliverables:

➢ Build the complete solution using CloudFormation, download the .png file and
provide the S3 bucket link of images

➢ Configure all the services and create a document that includes the screenshots of
the configured services. Upload the document on the LMS

Common questions

Powered by AI

To ensure a cost-effective architecture, use AWS Cost Explorer to analyze and monitor spending patterns. Select cost-efficient instance types for different workloads; deploying the application on reserved instances can significantly reduce costs compared to on-demand pricing for predictable traffic. Utilize Auto Scaling to scale resources dynamically based on actual demand, avoiding over-provisioning and unnecessary expenditure. Implement AWS Trusted Advisor for ongoing optimization recommendations across resource utilization and cost savings. Consider using spot instances for non-critical or batch workloads, providing significant savings over regular instance pricing .

AWS Elastic Beanstalk simplifies the deployment process by abstracting the underlying infrastructure aspect, allowing developers to focus on writing code. It automatically handles the details of capacity provisioning, load balancing, scaling, and application health monitoring. By integrating with version control systems such as Git, Elastic Beanstalk can be configured to automatically pull the latest code changes from the master branch, build the application environment, and deploy it onto EC2 instances. This provides a seamless CI/CD pipeline directly from the developer's repository to the AWS environment .

Deploying a globally cached web application can be achieved by setting up AWS CloudFront, a content delivery network (CDN) that caches application data at edge locations around the world. This minimizes latency by serving user requests from the nearest available cache location. The application should be configured with an origin pointing to the Elastic Beanstalk environment or S3 bucket hosting the application. By setting appropriate caching headers and invalidation rules, content is efficiently cached and refreshed as needed. This setup ensures fast content delivery and reduced load on origin servers, improving user experience globally .

Amazon S3 can be used to store images required by the React frontend securely. S3 provides secure storage with features such as bucket policies, access control lists (ACLs), and Identity and Access Management (IAM) roles to restrict who can access the images. To ensure data is transmitted securely, the frontend should access images over HTTPS, which can be enforced by S3 bucket settings. Furthermore, using S3 Transfer Acceleration can improve upload and download speeds for users globally. Images can also be served via AWS CloudFront, its CDN, providing additional caching capabilities and lower latency access .

To ensure a secure virtual network, the solutions architect should implement AWS Virtual Private Cloud (VPC) to create an isolated network environment. Within this VPC, they should set up public and private subnets: the public subnet would host the frontend on Elastic Beanstalk while the private subnet would host the database. Security Groups and Network Access Control Lists (ACLs) can be used to restrict inbound traffic to only essential ports (e.g., port 443 for HTTPS) and allow database connections only from the internal network. Furthermore, the frontend can communicate with the database using endpoint services such as RDS, ensuring the database is not exposed to the internet. This setup would virtually isolate the network while maintaining accessibility for the frontend .

AWS CloudWatch Logs can be used to capture and store application activity logs. These logs can be consolidated and transferred automatically to Amazon S3 for storage through CloudWatch Log Streams and Log Subscriptions. AWS Lambda functions can be triggered to process these logs into a predefined format, such as CSV, and store them in a database like Amazon Redshift for analysis. Analytical queries and dashboards can then be created using Amazon QuickSight, which easily integrates with Redshift, to provide visualizations of log data, enabling real-time insights into application performance and user behavior .

To ensure disaster recovery, the start-up should maintain regular backups using AWS Backup or snapshots for both the web and database servers. For the database, utilizing RDS automated backups and snapshots can provide point-in-time recovery. The deployment infrastructure can be codified using AWS CloudFormation, enabling the recreation of the environment quickly in case of a disaster. Implementing multi-AZ deployments for databases can provide high availability, allowing the system to switch over automatically in case of a failure. Enabling S3 versioning and cross-region replication can ensure that data is protected against accidental deletion or regional failures, providing a robust backup solution .

AWS ensures high availability for frontend applications through Elastic Load Balancing (ELB), which routes traffic to healthy instances across multiple Availability Zones (AZs). If one instance or AZ becomes unavailable, ELB automatically redirects traffic to other healthy instances. Auto Scaling groups can be configured to replace any failed instances automatically. By deploying in multiple AZs, the system provides redundancy and resilience against zonal failures, maintaining uninterrupted service availability for the frontend application even if individual VMs fail .

To handle uncertain traffic patterns and ensure scalability, Auto Scaling groups should be configured to manage the number of running EC2 instances dynamically. Minimum and maximum instance thresholds can be set to maintain at least two instances running at all times and scale up to four instances during traffic spikes. Load balancing should be implemented using AWS Elastic Load Balancing (ELB) to distribute incoming traffic across available instances evenly, ensuring no single instance is overwhelmed. Monitoring services like Amazon CloudWatch can be used to set up triggers based on CPU utilization or network traffic to automate scaling actions, ensuring optimal resource utilization and response to traffic variations .

AWS CloudFormation allows developers to define infrastructure as code, creating a JSON or YAML template that describes all the AWS resources needed for an application's architecture. This template can be used to provision and configure resources automatically by CloudFormation, ensuring consistency across environments. It facilitates repeatability, easy updates, and version control of infrastructure. By downloading the graphical representation of stacks as .png files and storing them in an S3 bucket, the start-up can document its infrastructure setup comprehensively. This automated setup minimizes manual intervention and errors while enabling infrastructure changes to be tracked and rolled back if needed .

You might also like