Which additional set of changes should the developer make to the application to improve the application’s performance?
Use an EC2 instance to host the MySQL database. Store the session data and the application data in the MySQL database.
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.
Use Amazon ElastiCache for Memcached to store and manage the session data and the application data.
Use the EC2 instance store to manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data.
Explanations:
Hosting the MySQL database on an EC2 instance does not resolve the memory issues caused by session management on the web server. Additionally, storing session data in the MySQL database would increase database load and latency, which could further degrade performance during peak traffic.
Using Amazon ElastiCache for Memcached offloads session data management from the web server, reducing memory usage and improving performance. Amazon RDS for MySQL provides a managed database service that scales well, ensuring efficient handling of application data while improving reliability and maintenance.
While using Amazon ElastiCache for Memcached for session data is beneficial, storing both session and application data in ElastiCache is not appropriate. Memcached is not designed for persistent storage of application data, which is best suited for a relational database like MySQL. This option would lead to data loss in case of cache invalidation.
Using the EC2 instance store for session data is not recommended due to its ephemeral nature; data stored here would be lost if the instance is stopped or terminated. While Amazon RDS for MySQL is a suitable choice for application data, relying on instance store for sessions would introduce significant risk and instability in session management.