nerdexam
Google

PROFESSIONAL-CLOUD-ARCHITECT · Question #30

A news teed web service has the following code running on Google App Engine. During peak load, users report that they can see news articles they already viewed. What is the most likely cause of this…

The correct answer is A. The session variable is local to just a single instance. AppEngine spins up new containers automatically according to the load. During peak traffic, HTTP requests originated by the same user could be served by different containers. Given that the variable sessions is recreated for each container, it might store different data. The…

Submitted by parkjh· Mar 30, 2026Ensuring solution and operations reliability

Question

A news teed web service has the following code running on Google App Engine. During peak load, users report that they can see news articles they already viewed. What is the most likely cause of this problem?

Options

  • AThe session variable is local to just a single instance.
  • BThe session variable is being overwritten in Cloud Datastore.
  • CThe URL of the API needs to be modified to prevent caching.
  • DThe HTTP Expires header needs to be set to -1 to stop caching.

How the community answered

(22 responses)
  • A
    64% (14)
  • B
    23% (5)
  • C
    5% (1)
  • D
    9% (2)

Explanation

AppEngine spins up new containers automatically according to the load. During peak traffic, HTTP requests originated by the same user could be served by different containers. Given that the variable sessions is recreated for each container, it might store different data. The problem here is that this Flask app is stateful. The sessions variable is the state of this app. And stateful variables in AppEngine / Cloud Run / Cloud Functions are problematic. A solution would be to store the session in some database (e.g. Firestore, Memorystore) and retrieve it from there. This way the app would fetch the session from a single place and would be

Topics

#App Engine#session management#instance state#stateless design

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-ARCHITECT Practice