In this documents, the server architecture will be explained which will be best suited for auto scalability, high performance, low latency and to handle millions on simultaneous requests.
As the current application is using different AWS services for different purpose, we can use different AWS services to scale the server architecture. Please find below the AWS server architecture diagram which we propose:
Below is the description of every service mentioned in the server architecture diagram:
1. AWS Route53:
Amazon Route 53 is a highly available and scalable cloud Domain Name System (DNS) web service. It is designed to give developers and businesses an extremely reliable and cost-effective way to route end users to effectively connects to infrastructure running in AWS – such as Amazon EC2 instances, Elastic Load Balancing load balancers, or Amazon S3 buckets.
2. AWS Shield:
AWS Shield is a managed Distributed Denial of Service (DDoS) protection tool for your AWS-based applications. DDoS attacks are malicious attacks on servers or network infrastructures that attempt to disrupt normal traffic. They’re often effective because they utilize multiple computers (usually compromised ones) as the sources of the attacks, overwhelming the target’s capacity. Since DDoS attacks are one of the most common types of attacks, having a dedicated security service for them is wise.
3. AWS Cloudfront:
Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment. CloudFront offers the most advanced security capabilities, including field-level encryption and HTTPS support, seamlessly integrated with AWS Shield and Amazon Route 53
4. AWS S3:
Amazon Simple Storage Service (S3) is a cloud storage solution provided by Amazon Web Services. As we have checked, AWS S3 is already being used in the current application and we also suggest to keep using this service for new development as well.
5. AWS ELB:
Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve greater levels of fault tolerance in your applications, seamlessly providing
the required amount of load balancing capacity needed to distribute application traffic. Elastic Load Balancing detects unhealthy instances and automatically reroutes traffic to healthy instances until the unhealthy instances have been restored. Customers can enable Elastic Load Balancing within a single or multiple Availability Zones for more consistent application performance
6. AWS EC2 Auto Scaling:
Amazon EC2 Auto Scaling helps you maintain application availability and allows you to automatically add or remove EC2 instances according to conditions you define.
7. AWS EC2:
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.
Redis is an open-source, in-memory data structure store, used as a database, cache, and message broker. All Redis data resides in memory, which enables low latency and high throughput data access.
9. AWS RDS:
Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks. RDS is currently being used in the system and we suggest keeping using RDS for new development.
10: AWS Cloudwatch:
Amazon CloudWatch is a monitoring and observability service which provides the data and actionable insights to monitor the applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, providing you with a unified view of AWS resources, applications, and services that run on AWS and on-premises servers.
11. AWS SNS:
Amazon Simple Notification Service (Amazon SNS) is a fully managed messaging service. AWS SNS can be connected with AWS cloudwatch to provide notifications for different events.
12. AWS GuardDuty:
Amazon GuardDuty is a threat detection service that continuously monitors for malicious activity and unauthorized behavior to protect your AWS accounts, workloads, and data stored in Amazon S3.
Web API Request Flow Diagram
Below is the web request flow diagram:
For the web services, we will be using Laravel Lumen Framework. It is a fast PHP micro-framework for building web services. As the current application is built on Laravel Framework, so it will be easy to reuse the logics, which will be more productive.
For the frontend, we recommend using Angular Framework. It is a Type Script-based free and open-source web application framework maintained by Google. The powers of Angular allow getting highly performant, smart, and user-friendly web, mobile, and desktop solutions such as SPAs, PWAs, large-scale enterprise software, cross-platform mobile apps, etc.
3rd Party Notification Services:
For sending different notifications such as Email, SMS, and real-time webs notifications, we recommend using Sendgrid for transactional email service, Twilio for SMS, and One Signal for web notifications.
Backup and Disaster Recover Management:
For the database backups, we will be using 2 separate methods.
i. Custom DB Backup Script: We will be writing a custom DB backup script, which will take the database backup every 4 hours and will save the last 5 days db backup on S3.
ii. DB Snapshots: We will be using the AWS snapshot service for daily automated backups. We will be created the backup strategy so that the snapshots older than 5 days will get deleted automatically.
EC2 server Backups
For the EC2 instance backups, we will be using the EBS Snapshot service and will schedule the backups using AWS Data Lifecycle Manager and can create the snapshot policies. In case of any disaster, we can easily launch the same instance from the snapshot.