I want to read a huge MongoDB collection from Spark create an persistent RDD and do further data analysis on it.
Is there any way I can read the data from MongoDB faster. Have tried with the approach of MongoDB Java + Casbah
Can I use the worker/slave to read data in parallel from MongoDB and then save it as persistent data and use it.
There are two ways of getting the data from MongoDB to Apache Spark.
Method 1: Using Casbah (Layer on MongDB Java Driver)
Over here we are using Scala and Casbah to get the data first and then save it to HDFS.
Method 2: Spark Worker at our use
Better version of code: Using Spark worker and multiple core to use to get the data in short time.