The two types of metadata that NameNode server stores are in Disk and RAM.
Metadata is linked to two files which are:
- EditLogs: It contains all the latest changes in the file system regarding the last FsImage.
- FsImage: It contains the whole state of the namespace of the file system from the origination of the NameNode.
Once the file is deleted from HDFS, the NameNode will immediately store this in the EditLog.
All the file systems and metadata which are present in the Namenode’s Ram are read by the Secondary NameNode continuously and later get recorded into the file system or hard disk. EditLogs is combined with FsImage in the NameNode. Periodically, Secondary NameNode downloads the EditLogs from the NameNode, and then it is implemented to FsImage. The new FsImage is then copied back into the NameNode and used only after the NameNode has started the subsequent time.