Users log in, build a shopping cart, and are auto-logged-out after 30 minutes idle; the cart must persist across logins. Following Google best practices, where should you store session and shopping cart data?
Choose an answer
Tap an option to check your answer.
Correct answer: Store session data in Memorystore (Redis or Memcached) and shopping cart data in Firestore..
Why this is the answer
Storing session data in Memorystore (Redis or Memcached) is ideal for its low-latency, in-memory access, which is crucial for fast user authentication and session management. Redis and Memcached are designed for high-speed key-value lookups, perfect for temporary session information. Storing shopping cart data in Firestore is suitable because it's a NoSQL document database that offers flexible schema, real-time synchronization, and automatic scaling, ensuring cart data persists reliably across logins and can handle varying loads. Pub/Sub is a messaging service, not a data store for persistent user data. Cloud Storage is object storage, not optimized for structured, frequently accessed shopping cart data. Using MySQL on Compute Engine for both would require manual scaling and management, which is less efficient than managed services like Memorystore and Firestore.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed