Soru

Zorluk: ZorIdentify design principles of the AWS Cloud

A media streaming platform hosts its user profile service on AWS. The application is designed to store user session state locally in the memory of the individual Amazon EC2 instances that host the service. An Auto Scaling group automatically scales the number of EC2 instances out or in based on traffic demand. During off-peak hours, when the Auto Scaling group terminates underutilized instances, active users whose sessions were hosted on those specific instances are suddenly logged out and lose their progress. To align with AWS cloud design principles and prevent session loss, how should the application architecture be modified?

  1. Store the session state in a centralized, external data store such as Amazon ElastiCache or Amazon DynamoDB, making the web tier stateless.Cevap
  2. B
    Disable scale-in actions within the Auto Scaling group so that instances are never terminated once they are launched.
  3. C
    Consolidate the service onto a single, high-capacity Amazon EC2 instance to ensure all user session data is held in a centralized local memory space.
  4. D
    Use AWS CloudFormation to automatically redeploy the entire application stack whenever a user session is disconnected.

Cevap

Store the session state in a centralized, external data store such as Amazon ElastiCache or Amazon DynamoDB, making the web tier stateless.
Storing the session state in a centralized, external data store (such as Amazon ElastiCache or Amazon DynamoDB) makes the web tier stateless. This aligns with AWS design principles because the EC2 instances become completely interchangeable. When instances scale in or out, or if an instance fails, users are not logged out because their session data is safely retrieved from the external database or cache.

Adım Adım Çözüm

1
Identify the cause of user logouts during scale-in events.
User session data is stored locally in the memory of individual EC2 instances, meaning terminating an instance destroys the session data hosted on it.
To pinpoint the architectural bottleneck causing state loss.
2
Select the appropriate cloud design principle to address state dependency.
The concept of statelessness (under the 'Design for failure' and 'Elasticity' principles) requires separating compute resources from session state.
Decoupling session state makes the compute instances interchangeable, allowing seamless scaling and resilience.
3
Determine the target destination for externalized state.
Use a low-latency, centralized managed storage service like Amazon ElastiCache (in-memory) or Amazon DynamoDB (NoSQL key-value store).
This allows any running EC2 instance to fetch and update the session state for any user request.

Anahtar Kavram

Statelessness and Decoupling Application State
Bu soruyu puanla