SAN vs. NAS - Block I/O versus File I/O

Posted on 2014-03-31
Medium Priority
Last Modified: 2014-05-01
I checked out several links regarding the difference between a SAN and a NAS and I'm not understanding HOW block I/O is different than file I/O?
I also don't understand why block I/O is better than file I/O?
Question by:brothertruffle880
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 123
ID: 39967129
NAS do File I/O, e.g. the file is access through a remote file system, as a file reference. The file is read as a complete file. The file system will ask for the file, and a number of bytes will be read for the complete file.

SAN do Block I/O - when a request comes for a file, it's turned into a request to read several blocks which make up the file.
LVL 70

Assisted Solution

Qlemo earned 224 total points
ID: 40026022
You can imagine block I/O to be like accessing a hard disk. All sectors and blocks can be addressed directly. File I/O (usually) requires to read a stream up to the position you need data from.
Block I/O enables the host to know about the virtual or physical disk layout, cache and manage content aso. Changes are made at a very low level of disk operations, allowing for all kind of optimizations.
File I/O only can tell about the file name, and even needs to ask the storage system for size info and such. All tasks like "list directory" have to be sent to the storage system, which cannot know of the specifics of the application needing the info, and so not much of optimization of consecutive requests can be made.

NAS uses a file based approach, it is just another device connected remote, without the OS having sophisticated control over it.
SAN implements a storage access protocol you can imagine as IDE / SATA / SCSI / aso. embedded in network packets. This operates on a very low level, with sophisticated control over data.
LVL 21

Assisted Solution

SelfGovern earned 224 total points
ID: 40026054
It's also different in this:
In NAS, the NAS file-oriented device manages the space, creation of files, directories, etc.
In a SAN, the SAN block device presents a certain amount of space to the client, and then the client is responsible for managing the space.

The user sees some space and uses it -- doesn't usually make too much difference.

SAN-attach storage will typically be higher performance than NAS-attach storage, for what it's worth.  Historically, part of that was that NAS used an Ethernet network, and SAN used a Fibre Channel network, but with increasing speed on Ethernet, and use of iSCSI (over Ethernet) for SANs, the difference is a bit harder to categorize.
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

LVL 47

Assisted Solution

David earned 664 total points
ID: 40026089
Neither is "best" in all situations.  Rather than go through all the permutations, may I suggest you provide details about YOUR intended use, and then you can get an answer that is more relevant to your needs.
LVL 79

Accepted Solution

arnold earned 668 total points
ID: 40026108
SAN resources are presented as local drives on the system to which they are allocated.
NAS are remote resources.

Depending on your environment defines/limits functionality and which as Dlethe pointed is the best for your circumstances.
Some iscsi based sans provide you the option to choose the mode. Some OS/Application combination can not function with a NAS as the resource.

As others pointed out, a SAN presents you with a notebook into which you write and from which you read.  A NAS presents you with a notebook and writer/reader to whom you have to dictate what you want written, and who has to read the data back to you that you want.
LVL 39

Assisted Solution

by:Aaron Tomosky
Aaron Tomosky earned 220 total points
ID: 40026114
It may help if you think of this question as Nfs vs iscsi, instead of nas/San. Personally I run FreeBSD on a box. This box has one nic on my normal LAN sharing files over samba. That makes it a "nas". I have a second nic that shares over iscsi on a vlan just for esxi, that would be a "San". I can also share on my "San" over Nfs which is a file based share like samba, but it's on a "storage area network".

My point is that San and nas shouldn't really be compared. As you can see from my example, my box is both. The experts before me have treated your question as Nfs vs iscsi basically already, I just wanted to clear that up.  Once you search for Nfs vs iscsi you will find a bunch of opinions on the subject.
LVL 47

Assisted Solution

David earned 664 total points
ID: 40026124
Aaron makes a good point, NFS vs iSCSI is a great real world analogy because it is a block vs. file I/O comparison using two well understood implementations of block and file I/O that often use the same low-level protocols and usually the same cabling.  They can also coexist on same cabling and  server.

I use Solaris O/S and have ZFS shares on same host that use iSCSI, NFS and SMB.  The nice thing this does is that I can take  HOT LIVE SNAPSHOT BACKUPS of all of these from my solaris host no matter what the remote machines are doing, even if the O/S on the system mounting that data doesn't support such things.

So to add another twist, you should consider how these shares exist on the server that creates them, and what that server's file system can do.

Just because you can't take a hot snapshot of a NTFS share in windows w/o specialized hardware, doesn't mean it can't be done if the share is presented on a filesystem such as ZFS.

P.S. forgot, the same system emulates an Apple time capsule, so I use it as an apple time machine backup  for 2 MacBooks.  Also with ZFS I can tell it to do data compression on a share, or directly, or even keep extra copies of the data if I want.   You have flexibility on a host that has such features.
LVL 79

Assisted Solution

arnold earned 668 total points
ID: 40026144
Dlethe, I'm hesitant to ..

A SAN can include a NAS, a NAS can not include a SAN.

The main issue is scale.
The difference deals with level on which the commands are.
Iscsi still sends scsi commands over IP.  I believe some iscsi SANs provide an option on whether to use block or file I/O.

A NAS is either NFS or SAMBA. For unix/Linux environments the distinction is without a difference "functionally" /mounted resource or /mounted NFS resource .....

On a windows platform however, certain application will not function when the resource is not seen as a local resource (iscsi or FC than LUN) versus a network resource (samba, NFS share from NAS)
LVL 47

Assisted Solution

David earned 664 total points
ID: 40026160
An appliance is  an appliance.   They all have CPUs, local memory, local storage, and network interfaces.   They all run an O/S and software stacks that perform various services.  I assure you, a system can do all of the above.  

It is not a  NAS doing a  SAN or SAN doing a NAS.  You have an appliance that does both at the same time.  Yes, do not  use a windows based O/S as the appliance. That limits you.  

Read up on Solaris + ZFS, and you can do all of the above, at once.  I know an ISP that has around 500 petabytes doing this on tens of thousands of solaris-based servers.
LVL 79

Assisted Solution

arnold earned 668 total points
ID: 40026166
The issue in difference deals with scope and scale.

An appliance that presents both options (NFS/samba and iscsi/FC), would you not agree, would be referred to as a SAN
While an appliance that can only do (NFS/samba) will generally be referred to as a NAS.

The OS based distinction I was making dealt with the clients that access the resources.
Not the OS that runs/makes up the appliance.

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
"Any files you do not have backed up in at least two [other] places are files you do not care about."
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question