Storing your databases on HDFS provides increased high availability for the Dgraph—the contents of the databases are distributed across multiple nodes, so the Dgraph can continue to process queries if a node goes down. It also increases the amount of data your databases can contain.
If you have to co-locate the Dgraph with Spark or any other Hadoop services, you should use cgroups to isolate resources for it. For more information, see Setting up cgroups.