0 votes
in AWS by

A Developer is migrating an on-premises web application to the AWS Cloud. The application currently runs on a 32-processor server and stores session state in memory.

On Friday afternoons the server runs at 75% CPU utilization, but only about 5% CPU utilization at other times. How should the Developer change to code to better take advantage of running in the cloud?

1 Answer

0 votes
by

Answer - D.

ElastiCache is the perfect solution for managing session state.

This is also given in the AWS Documentation.

In order to address scalability and to provide a shared data storage for sessions that can be accessed from any individual web server, you can abstract the HTTP sessions from the web servers themselves.

A common solution to this is to leverage an In-Memory Key/Value store such as Redis and Memcached.

Option A is incorrect since compression is not the ideal solution.

Option B is incorrect since EC2 Instance Store is too volatile.

Option C is incorrect since this is ok from a security standpoint but will just make the performance worse for the application.

For more information on Session Management, please refer to the below Link-

https://aws.amazon.com/caching/session-management/

The optimal solution for storing session state data in the AWS Cloud depends on the specific needs of the application. However, in general, the best option is to use a scalable and highly available session state storage service.

Option A, compressing the session state data in memory, may help reduce memory usage, but it does not address the issue of scalability and availability.

Option B, storing session state on EC2 instance store, is not a recommended option because the instance store is ephemeral storage and can be lost if the instance fails or terminates. It is not a highly available storage solution.

Option C, encrypting the session state data in memory, may be a good security practice, but it does not address the scalability and availability requirements of the application.

Option D, storing session state in an ElastiCache cluster, is the recommended option for session state storage in the AWS Cloud. Amazon ElastiCache is a managed service that provides scalable and highly available in-memory data storage. By using ElastiCache, the application can take advantage of the distributed nature of the service and scale horizontally to handle the increased load on Friday afternoons. ElastiCache also provides features such as automatic failover and data replication across multiple Availability Zones, ensuring high availability of the data.

Therefore, the correct answer is D - Store session state in an ElastiCache cluster.

...