Prepare and test your skills

Prepare and test your skills

Free sample question, answered and explained below. The Professional Data Engineer practice bank has 1,353 more like it. Try 10 free: instant score, no account.
Your team is designing an event-driven data pipeline using Eventarc to trigger a Cloud Run microservice whenever a new file is uploaded to Cloud Storage. The microservice processes the file and updates a stateful database.
Because Eventarc guarantees at-least-once delivery, the microservice occasionally receives duplicate events for the same file upload, causing duplicate database entries. You need to implement a solution to prevent data duplication and ensure the database is only updated once per event.
What should you do?
Exactly-once delivery is a messaging concept where the infrastructure guarantees that a message is delivered to the consumer one and only one time, completely eliminating duplicates or losses at the network layer.
Eventarc does not offer a configuration toggle for an exactly-once delivery mode. It operates strictly on an at-least-once delivery model to prioritize high availability and reliability. Because the infrastructure cannot guarantee exactly-once delivery, the responsibility for deduplication must fall on the receiving consumer.
You were using a messaging system that natively supported and required exactly-once delivery configuration at the topic or subscription level (such as specific configurations in Apache Kafka or Pub/Sub exactly-once delivery), rather than Eventarc.
Polling is a technique where a client continuously requests data from a server or message broker at regular intervals to check for new or duplicate messages, rather than waiting for the server to push the data.
Event-driven architectures using Eventarc rely on push-based messaging. The event router automatically pushes the event to the microservice (e.g., via an HTTP POST request to Cloud Run). There is no endpoint on the Eventarc router for a microservice to poll and check for duplicates.
The architecture was explicitly designed around a pull-based messaging system (like a standard Pub/Sub pull subscription or an SQS queue) where the worker must actively fetch messages and manage their visibility timeouts.
xgooglemessageuid attribute from the CloudEvent and use it to perform a transactional check in the database to verify if the event has already been processedThe xgooglemessageuid is a CloudEvents attribute provided by Eventarc that uniquely identifies the action of publishing an event. It acts as a unique identifier for every distinct event routed through the system.
By extracting this unique identifier from the incoming event payload, the microservice can perform a transactional check against the database (such as querying a table of processed event IDs) before applying the update. If the ID is already present, the service recognizes the event as a duplicate and safely ignores it, effectively achieving exactly-once processing semantics.
Eventarc guarantees at-least-once delivery, meaning duplicate events can and will occur due to network retries or service restarts. The most robust architectural pattern to handle this is designing the receiving service to be idempotent. Using the built-in xgooglemessageuid for deduplication via an external transactional check is the recommended approach for state management in event-driven systems.
deduplicate_events flag on the Eventarc trigger to automatically filter and drop duplicate events before they are routed to the microserviceA deduplication flag or setting is a feature found in some messaging brokers that attempts to filter out duplicate messages at the infrastructure level before they ever reach the consumer application.
Eventarc does not have a deduplicate_events flag or a built-in filtering mechanism to drop duplicates before routing them to the target service. Eventarc routes events as they occur or as they are retried by the underlying infrastructure.
You were using a service that explicitly supported a deduplication configuration flag at the trigger or router level. Because Eventarc does not support this, the application code must handle the deduplication.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated