Spark yarn cluster vs client - how to choose which one to use?
<p>The spark <a href="https://spark.apache.org/docs/1.6.2/running-on-yarn.html#configuration" rel="noreferrer">docs</a> have the following paragraph that describes the difference between yarn client and yarn cluster:</p>

<blockquote>
  <p>There are two deploy modes that can be used to launch Spark applications on YARN. In cluster mode, the Spark driver runs inside an application master process which is managed by YARN on the cluster, and the client can go away after initiating the application. In client mode, the driver runs in the client process, and the application master is only used for requesting resources from YARN.</p>
</blockquote>

<p>I'm assuming there are two choices for a reason.  If so, how do you choose which one to use?</p>

<p>Please use facts to justify your response so that this question and answer(s) meet stackoverflow's requirements.</p>

<p>There are a few similar questions on stackoverflow, however those questions focus on the difference between the two approaches, but don't focus on when one approach is more suitable than the other.</p>