# Block Storage vs File Storage: The RWX Truth

## RWO vs RWX in Kubernetes — The Real Difference Between Block Storage and FileStorage

If you’ve worked with Kubernetes volumes, you’ve probably seen this statement:

> “EBS (or any block storage) only supports RWO (ReadWriteOnce).  
> For RWX (ReadWriteMany), you need something like EFS.”

If you’ve ever wondered **why that is**, you’re not alone. I had the same question when I first learned it. Let’s break it down properly.

# Before the Crux — Let’s Get the Basics Right

## What Is Block Storage?

Block storage is essentially a **raw disk**. When you create an EBS volume, Kubernetes (or the operating system) sees it as:

> “Here’s an empty hard drive. You decide how to use it.”

Since it’s raw, it must be **formatted with a filesystem** (like ext4 or xfs) before use.

## Formatting what is it ?

Formatting means creating a **filesystem structure** on the disk. Think of it like this:

* You have a blank notebook (raw disk)
    
* You draw structured grids inside it. Think of it like your Microsoft Excel
    
* Now you can store and retrieve values in specific locations by mapping the Row and Column.
    

In the same way the disk gets divided into **blocks**, and the filesystem keeps track of:

* Which block belongs to which file
    
* Where data is stored
    
* How to retrieve it quickly
    

## Do you know the Block Storage have Fast I/O. You know why ?'

Because block storage allows **direct access to data blocks**. When an application wants data, the operating system can say: `“Give me block #504.”` it retrieve it directly from the Block storage Disk nothing between the storage and the Operating System.

That’s why block storage is:

* Low latency
    
* High performance
    
* Ideal for databases
    

## Then Why Can’t Block Storage Support RWX?

A traditional filesystem (like ext4 or xfs) is not cluster-aware. If you attach the same block disk to multiple nodes and both try to write:

* Filesystem corruption can occur
    
* There’s no built-in distributed locking (So that when one node is using it it locks other node)
    
* Metadata can conflict (If some node tries to write and other tries to modify the metadata conflict occurs.)
    
    * Metadata is nothing but the information about the data stored such as when it is created what is the size etc.
        

Block storage assumes: ***“One disk → one machine managing the filesystem.”***

That’s why:

* EBS supports **ReadWriteOnce (RWO)**
    
* It cannot safely support **ReadWriteMany (RWX)**
    

---

# What Is File Storage?

File storage (like EFS) is different. It is

* Already formatted
    
* Managed by a **file server**
    
* Exposed over the network (NFS in EFS case)
    

Instead of giving you raw blocks, it gives you ***A shared file system accessible over the network.***

## You may ask How Is File Storage Different ?

Even file storage uses blocks internally but the key difference is:

* A **central file server manages metadata**
    
* It handles locking
    
* It coordinates concurrent access
    
* It ensures consistency
    

Every file contains metadata like:

* Permissions
    
* Ownership
    
* Size
    
* Timestamps
    
* Access rules
    

## What happens when multiple nodes try to connect ?

* They don’t manage blocks directly
    
* **They talk to the file server**
    
* **The file server manages read/write coordination**
    

That’s what enables **RWX**.

## Is File Storage Slower?

Generally, yes — compared to block storage. Why?

Because:

* It involves network communication
    
* Metadata validation happens
    
* There’s coordination overhead
    

But the trade-off is: ***You get safe, shared, multi-node access.***

---

## The Real Crux

### Block storage:

* Attached to one node
    
* Filesystem managed locally
    
* No distributed locking
    
* High performance
    
* Supports RWO
    

### File storage:

* Managed by centralized file servers
    
* Supports distributed locking
    
* Safe concurrent access
    
* Supports RWX
    
* Slightly higher latency
    

## The Mental Model

Think of it like this:

### Block Storage (EBS)

Like a USB drive plugged into one laptop. Only that laptop controls it.

### File Storage (EFS)

Like a shared Google Drive folder. Multiple machines can access it at the same time.
