I have written a structured streaming app to push data real time to S3. We receive data from Kafka and push data to S3 after processing data using structured streaming.
I know Spark streaming supports dynamic allocation of resources. But found following JIRA https://issues.apache.org/jira/browse/SPARK-24815 that says dynamic allocation of resource is not supported by structured streaming.
Want to know to handle spike in data when dynamic allocation of resources is not currently supported for structured streaming.
Reasoning for NOT implementing Dynamic Allocation is Following (From JIRA): If we set spark.dynamicAllocation.enabled=true and run a structured streaming job, the batch dynamic allocation algorithm kicks in. It requests more executors if the task backlog is a certain size, and removes executors if they idle for a certain period of time. It is basically meant for batch processing not continuous processing. In batch mode we care about the numRunningOrPendingTasks while for streaming about the ratio: averageBatchProcTime.toDouble / batchDurationMs i.e. average batch processing time per unit of time, so scaling the system down when idle is not a valid solution.
Question: How to handle SPIKES when dynamic allocation of resources is NOT provided.