Learn how to migrate an online retail application to AWS using Amazon EC2, Auto Scaling, Application Load Balancer, and ElastiCache. Find out the best solution for managing session data and application data in AWS.
Table of Contents
Question
A developer needs to migrate an online retail application to AWS to handle an anticipated increase in traffic. The application currently runs on two servers: one server for the web application and another server for the database. The web server renders webpages and manages session state in memory. The database server hosts a MySQL database that contains order details. When traffic to the application is heavy, the memory usage for the web server approaches 100% and the application slows down considerably.
The developer has found that most of the memory increase and performance decrease is related to the load of managing additional user sessions. For the web server migration, the developer will use Amazon EC2 instances with an Auto Scaling group behind an Application Load Balancer.
Which additional set of changes should the developer make to the application to improve the application’s performance?
A. Use an EC2 instance to host the MySQL database. Store the session data and the application data in the MySQL database.
B. Use Amazon ElastiCache for Memcached to store and manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data.
C. Use Amazon ElastiCache for Memcached to store and manage the session data and the application data.
D. Use the EC2 instance store to manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data.
Answer
B. Use Amazon ElastiCache for Memcached to store and manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data.
Explanation
The correct answer is B. Use Amazon ElastiCache for Memcached to store and manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data.
Here is an explanation of why this solution will improve the application’s performance:
- The problem is that the online retail application suffers from high memory usage and low performance when traffic is heavy. The main cause of this problem is that the web server manages session state in memory, which consumes a lot of resources and slows down the application.
- To solve this problem, the developer needs to migrate the application to AWS and make some changes to the application architecture. The developer has already decided to use EC2 instances with Auto Scaling and Application Load Balancer for the web server migration, which will provide scalability and high availability for the web application layer.
- However, the developer also needs to make some changes to the data layer of the application, which consists of session data and application data. Session data is the information that is stored for each user session, such as user preferences, shopping cart items, and authentication tokens. Application data is the information that is stored for the business logic of the application, such as order details, product catalog, and customer profiles.
- The solution that will improve the performance of the data layer is to use ElastiCache for Memcached and RDS for MySQL. ElastiCache for Memcached is a fully managed service that provides fast and scalable in-memory data storage and caching. It can be used to store and manage session data, which will reduce the load on the web server and improve the response time of the application. RDS for MySQL is a fully managed service that provides reliable and secure relational database storage. It can be used to store and manage application data, which will provide durability and consistency for the business transactions of the application.
- This solution will improve the performance of the application because it will separate the session data from the application data, and use different services that are optimized for different types of data. ElastiCache for Memcached will provide low-latency access to session data, which will enhance the user experience and reduce resource consumption on the web server. RDS for MySQL will provide high-throughput access to application data, which will support the business operations and analytics of the application.
Therefore, option B is the correct solution that will improve the performance of the application. Option A is incorrect because it will not reduce the memory usage or improve the performance of the web server, as it will still store session data in a MySQL database on an EC2 instance. Option C is incorrect because it will not provide reliable or consistent storage for application data, as it will store both session data and application data in ElastiCache for Memcached, which is a volatile cache that does not guarantee durability or transactionality. Option D is incorrect because it will not provide fast or scalable access to session data, as it will store session data in the EC2 instance store, which is a local disk that does not support replication or caching.
The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.