I installed HDP using Apache Ambari, and saw it uses inbuilt default database -> PostgreSQL.
What is the need of the DB for installing the HDP using Apache Ambari?
Ambari is used to provision, manage, and monitor a Hadoop cluster. For it to be capable enough to do all those things it must keep a lot of information about all the services in the cluster, it keeps track of all this information in the database.
For example, all the service configurations is stored in a central location (the database) (hbase-site.xml, yarn-site.xml, etc.) and then written to each node by the ambari-agent process. Another example would be service state. Ambari keeps track of what state a service is in (INSTALLED, STARTED, STOPPED, etc.), this information is stored in the database as well.