0% found this document useful (0 votes)
11 views3 pages

HDFS Overview and Key Features

Hadoop Distributed File System (HDFS) is designed for storing extremely large files across a network of commodity hardware, providing reliable and fault-tolerant data storage. It uses a master-slave architecture with a NameNode managing metadata and DataNodes storing the actual data, which is divided into blocks for efficient access and replicated for fault tolerance. While HDFS excels in high-throughput data access, it struggles with low-latency requirements and inefficiencies related to handling numerous small files.

Uploaded by

rajeshmeheto.ica
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

HDFS Overview and Key Features

Hadoop Distributed File System (HDFS) is designed for storing extremely large files across a network of commodity hardware, providing reliable and fault-tolerant data storage. It uses a master-slave architecture with a NameNode managing metadata and DataNodes storing the actual data, which is divided into blocks for efficient access and replicated for fault tolerance. While HDFS excels in high-throughput data access, it struggles with low-latency requirements and inefficiencies related to handling numerous small files.

Uploaded by

rajeshmeheto.ica
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Introduction to Hadoop Distributed File

System(HDFS)
Last Updated : 04 Apr, 2025


With growing data velocity the data size easily outgrows the storage limit of a
machine. A solution would be to store the data across a network of machines.
Such filesystems are called distributed filesystems. Since data is stored
across a network all the complications of a network come in.
This is where Hadoop comes in. It provides one of the most reliable
filesystems. HDFS (Hadoop Distributed File System) is a unique design that
provides storage for extremely large files with streaming data access pattern,
and it runs on commodity hardware. Let's elaborate on the terms:
 Extremely large files: Here, we are talking about the data in a range of
petabytes (1000 TB).
 Streaming Data Access Pattern: HDFS is designed on principle of write-
once and read-many-times. Once data is written large portions of dataset
can be processed any number times.
 Commodity hardware: Hardware that is inexpensive and easily available in
the market. This is one of the features that especially distinguishes HDFS
from other file systems.
Nodes: Master-slave nodes typically form the HDFS cluster.
1. NameNode(MasterNode):

 Manages all the slave nodes and assigns work to them.


 It executes filesystem namespace operations like opening, closing, and
renaming files and directories.
 It should be deployed on reliable hardware that has a high configuration.
not on commodity hardware.
2. DataNode(SlaveNode):

Actual worker nodes do the actual work like reading, writing, processing,
etc.
 They also perform creation, deletion, and replication upon instruction
from the master.
 They can be deployed on commodity hardware.
HDFS daemons: Daemons are the processes running in the background.
 Namenodes:

o Run on the master node.


oStore metadata (data about data) like file path, the number of
blocks, block Ids. etc.
o Requires a high amount of RAM.
o Store meta-data in RAM for fast retrieval i.e to reduce seek time.
Though a persistent copy of it is kept on disk.
 DataNodes:

oRun on slave nodes.


o Require high memory as data is actually stored here.
Data storage in HDFS: Now let's see how the data is stored in a distributed
manner.

Lets assume that 100TB file is inserted, then masternode(namenode) will


first divide the file into blocks of 10TB (default size is 128 MB in Hadoop 2.x
and above). Then these blocks are stored across different
datanodes(slavenode). Datanodes(slavenode) replicate the blocks among
themselves and the information of what blocks they contain is sent to the
master. Default replication factor is 3 means for each block 3 replicas are
created (including itself). In [Link] we can increase or decrease the
replication factor i.e we can edit its configuration here.

Note: MasterNode has the record of everything, it knows the location and info
of each and every single data nodes and the blocks they contain, i.e. nothing is
done without the permission of masternode.

Why divide the file into blocks?

Answer: Let's assume that we don't divide, now it's very difficult to store a 100
TB file on a single machine. Even if we store, then each read and write
operation on that whole file is going to take very high seek time. But if we have
multiple blocks of size 128MB then its become easy to perform various read
and write operations on it compared to doing it on a whole file at once. So we
divide the file to have faster data access i.e. reduce seek time.

Why replicate the blocks in data nodes while storing?

Answer: Let's assume we don't replicate and only one yellow block is present
on datanode D1. Now if the data node D1 crashes we will lose the block and
which will make the overall data inconsistent and faulty. So we replicate the
blocks to achieve fault-tolerance.

Terms related to HDFS:


 HeartBeat : It is the signal that datanode continuously sends to namenode.
If namenode doesn't receive heartbeat from a datanode then it will consider
it dead.
 Balancing : If a datanode is crashed the blocks present on it will be gone
too and the blocks will be under-replicated compared to the remaining
blocks. Here master node(namenode) will give a signal to datanodes
containing replicas of those lost blocks to replicate so that overall
distribution of blocks is balanced.
 Replication:: It is done by datanode.

Note: No two replicas of the same block are present on the same datanode.

Features:
 Distributed data storage.
 Blocks reduce seek time.
 The data is highly available as the same block is present at multiple
datanodes.
 Even if multiple datanodes are down we can still do our work, thus making it
highly reliable.
 High fault tolerance.

Limitations: Though HDFS provide many features there are some areas
where it doesn't work well.
 Low latency data access: Applications that require low-latency access to
data i.e in the range of milliseconds will not work well with HDFS, because
HDFS is designed keeping in mind that we need high-throughput of data
even at the cost of latency.
 Small file problem: Having lots of small files will result in lots of seeks and
lots of movement from one datanode to another datanode to retrieve each
small file, this whole process is a very inefficient data access pattern.

Common questions

Powered by AI

HDFS offers high data availability and reliability through its distributed architecture. Key features include data replication across multiple nodes, allowing HDFS to recover from node failures without data loss. The distributed storage of blocks ensures no two replicas reside on the same DataNode, minimizing risk in cases of hardware failures . The system's design of managing large files over smaller manageable blocks reduces seek times and optimizes processing across available resources, further enhancing data access efficiency . These features together make HDFS a robust system for high reliability and availability, ensuring continuous operations .

HDFS facilitates efficient storage of large datasets by dividing files into smaller blocks, which are then stored across multiple data nodes. This approach allows the system to handle petabyte-scale datasets, as opposed to a single machine struggling with such immense data. The block division not only makes storage manageable across distributed nodes but also enhances data access speed and reliability through parallel operations and replication strategies . By separating storage across nodes, HDFS overcomes the limitations of traditional filesystems which are constrained by the physical storage capacities of individual machines, enhancing both fault tolerance and data availability at a massive scale .

Replication and block distribution are central to HDFS's fault tolerance. By replicating each data block across multiple DataNodes (commonly three nodes), the system ensures that even if a DataNode fails, the data can still be retried from other nodes that have replicas. This redundancy prevents data loss and maintains consistency despite hardware failures . Additionally, no two replicas of the same block are stored on the same node, further enhancing fault tolerance by dispersing data distribution and minimizing risks associated with node failures . It allows load balancing across all nodes and supports continual operations even if some nodes encounter issues .

HDFS handles potential data inconsistencies due to node failures using block replication and the HeartBeat mechanism. When a node fails, the NameNode, upon not receiving a HeartBeat, marks the node as dead and commences re-replication of the blocks it stored from surviving DataNodes that contain duplicates. By maintaining at least the preset replication factor, HDFS ensures that a consistent state is recoverable even after hardware failures . Furthermore, the NameNode keeps precise track of block locations and statuses, coordinating replication to maintain system balance and prevent data inconsistencies across the cluster . This strategic approach enables HDFS to preserve consistency and integrity of data across failures.

The NameNode is crucial in an HDFS cluster because it operates as the master node, managing namespace operations and coordinating the DataNodes by maintaining all filesystem metadata. Thus, its failure can render an entire HDFS cluster inoperative. It is important to deploy the NameNode on reliable, high-performance hardware to ensure system reliability and fast retrieval of metadata stored in RAM. Reliable hardware helps prevent single points of failure and supports the NameNode's intensive demands for memory and processing power .

Adjusting the replication factor in HDFS configuration is vital for optimizing storage efficiency and fault tolerance. A higher replication factor increases data reliability by providing more backup copies, while a lower factor saves storage resources. The replication factor directly impacts system performance; higher replication decreases risks of data loss during node failures at the cost of additional storage and network use, potentially affecting the overall cluster throughput. Conversely, a lower factor might economize storage and network bandwidth but at a risk of reduced data reliability . Thus, balancing the replication factor according to system needs and resource availability is critical for achieving optimal performance.

HDFS may not be ideal in scenarios that require low-latency data access or involve numerous small files. The architecture is designed to prioritize high throughput over low latency, leading to inefficiencies in applications needing quick access times measured in milliseconds . Moreover, the "small file problem" arises when HDFS handles many small files inefficiently, causing an extensive number of seek operations and high disk movement across nodes, leading to suboptimal data retrieval performance . These limitations suggest that applications requiring efficient handling of numerous small files or extremely low-latency access are better served by alternative storage solutions that are optimized for such workloads.

HDFS balances the load across DataNodes by distributing file blocks evenly across available nodes and allowing multiple replicas of each block. When a DataNode becomes unavailable, the NameNode detects the loss through ceased HeartBeat signals and initiates a process to restore balance by instructing other DataNodes that have replicas of the lost blocks to create new replicas. This proactive re-replication maintains the set replication factor, enhancing data resiliency and preventing under-replication . The balance ensures efficient resource utilization and preserves data availability across the cluster despite individual node failures .

DataNodes in HDFS are responsible for storing actual data and executing read, write, and replication operations. Because HDFS leverages data replication and distributes blocks across multiple nodes, it can afford to use inexpensive commodity hardware for DataNodes without compromising system reliability or data availability . If a DataNode fails, its data is still accessible from other nodes that contain its replicas. In contrast, the NameNode requires more robust hardware due to its critical role in maintaining metadata and coordinating node activities. Deploying NameNodes on high-performance hardware minimizes the likelihood of failure in this crucial coordination role .

The HeartBeat mechanism in HDFS is critical for maintaining integrity and coordination within the cluster. Each DataNode sends regular HeartBeat signals to the NameNode, confirming its active status. These signals help the NameNode identify failed DataNodes promptly, as the absence of a heartbeat indicates a node might be down . Upon identifying inactive nodes, the NameNode can initiate re-replication of blocks from surviving nodes, ensuring data availability and system stability despite hardware failures. This mechanism enables dynamic cluster management and preserves data consistency throughout distributed operations .

You might also like