title: Is it feasible to save data from SparkStreaming to Cassandra from Spark Workers
body: <p>SparkStreamingContext is created on driver and it can't be serialized. So, we cannot access this object on workers. Now to make use of distributed nature of Spark we would be processing the data/stream on workers. Hence, it make sense to save data directly from workers rather than collecting all the data to driver which might give OOM. </p>
  
  <p>I have the scenario like this where i need to apply some business logic and finally need to store the data to cassandra. So, how do i do it?</p>
  
  <pre><code>DStream.foreachRDD{ x =&gt; x.foreachPartition {  some logic and finally Store the data to cassandra }  } 
  </code></pre>