In Apache Spark, the persist() function is used to allow the user to specify the storage level, whereas the cache() function uses the default storage level.