Spark best practice