nerdexam
Databricks

CERTIFIED-DATA-ENGINEER-PROFESSIONAL · Question #21

A Structured Streaming job deployed to production has been experiencing delays during peak hours of the day. At present, during normal execution, each microbatch of data is processed in less than 3…

The correct answer is E. Decrease the trigger interval to 5 seconds; triggering batches more frequently may prevent. Decreasing the trigger interval to 5 seconds causes Spark to fire microbatches more frequently. Because each trigger interval is shorter, less data accumulates between triggers, resulting in smaller microbatches. Smaller batches are faster to process, which helps keep…

Streaming Data Processing

Question

A Structured Streaming job deployed to production has been experiencing delays during peak hours of the day. At present, during normal execution, each microbatch of data is processed in less than 3 seconds. During peak hours of the day, execution time for each microbatch becomes very inconsistent, sometimes exceeding 30 seconds. The streaming write is currently configured with a trigger interval of 10 seconds. Holding all other variables constant and assuming records need to be processed in less than 10 seconds, which adjustment will meet the requirement?

Options

  • ADecrease the trigger interval to 5 seconds; triggering batches more frequently allows idle
  • BIncrease the trigger interval to 30 seconds; setting the trigger interval near the maximum
  • CThe trigger interval cannot be modified without modifying the checkpoint directory; to maintain the
  • DUse the trigger once option and configure a Databricks job to execute the query every 10
  • EDecrease the trigger interval to 5 seconds; triggering batches more frequently may prevent

How the community answered

(58 responses)
  • A
    5% (3)
  • B
    14% (8)
  • C
    2% (1)
  • D
    7% (4)
  • E
    72% (42)

Explanation

Decreasing the trigger interval to 5 seconds causes Spark to fire microbatches more frequently. Because each trigger interval is shorter, less data accumulates between triggers, resulting in smaller microbatches. Smaller batches are faster to process, which helps keep individual batch execution times under the 10-second requirement during peak load. Option A is wrong because 'triggering batches more frequently allows idle' is a nonsensical or misleading justification. Option B (increase to 30s) would make batches larger and slower, violating the <10s requirement. Option C is incorrect because checkpoints can be reused when changing only the trigger interval. Option D (trigger once) is for one-time batch execution, not continuous streaming. Option E correctly identifies that more frequent, smaller batches can prevent the processing time from exceeding 10 seconds.

Topics

#Structured Streaming#Performance Optimization#Trigger Interval#Microbatch Processing

Community Discussion

No community discussion yet for this question.

Full CERTIFIED-DATA-ENGINEER-PROFESSIONAL Practice