Describe the internal mechanics of Hadoop MapReduce or HDFS, and explain how it compares to Spark's in-memory processing.