Google Cloud Professional Cloud Developer — Question 354

You are a developer at an ecommerce company. You are tasked with developing a globally consistent shopping cart for logged-in users across both mobile and desktop clients. You need to configure how the items that are added to users’ carts are stored. How should you configure this cart service?

Answer options

Correct answer: B

Explanation

The correct answer is B because using Firestore allows for efficient storage and retrieval of user-specific data, with user IDs providing a unique and secure key. Option A is not suitable because IP addresses can change and are not unique to a user. Option C is inappropriate since using passwords as keys introduces security risks, and option D is limited by cookie size restrictions and is not secure for storing cart data.