Difference: 1. SAN can be regarded as a disk on the network; and NAS can be regarded as a file system on the network. 2. NAS connects the storage media to the LAN in the form of files; while the SAN connects the storage media to the storage media in the form of blocks and optical fibers.
Related recommendations: " Programming Video"
SAN: STORAGE AREA NETWORK Storage Area Network
NAS: NETWORK ATTACHED STORAGE Network Attached Storage
NAS is not necessarily a disk array. An ordinary host can make a NAS, as long as it has its own disk and file system, and provides external access to its file system. interface (such as NFS, CIFS, etc.), it is a NAS. A commonly used Windows file sharing server is a NAS device that uses CIFS as the calling interface protocol. Generally speaking, a NAS is actually a shared server on an Ethernet network that uses network file systems such as NFS and CIFS. As for whether there will be a file provider on the FC network in the future, that is, a NAS on the FC network, we will have to wait and see in the future.
Note:
NFS(NETWORK FILE SYSTEM) is applicable to LINUX&UNIX system
CIFS(Common Internet FILE SYSTEM) is applicable For windows system
The difference between SAN\NAS:
can be compared like this: SAN is a disk on the network; NAS is a File system on the network. In fact, according to the definition of SAN, it can be seen that SAN actually refers to a network, but this network contains various elements, such as hosts, adapters, network switches, disk array front-ends, disk array back-ends, disks, etc. For a long time, people have been accustomed to using SAN to refer specifically to FC and remote disks.
So, once a NAS based on FC network is designed, what should the SAN be called at this time?
So, when talking about the difference between the two, we use an analogy, that is, the disk on the FC network is called SAN, and the file system on the Ethernet network is called NAS. We can understand it simply.
NAS connects storage media to LAN in the form of files;
And SAN connects storage media to fiber optics in the form of blocks.
Ordinary desktop computers can also serve as NAS. There are two physical conditions that a NAS must meet:
First, no matter what method is used, The NAS must be able to access volumes or physical disks;
Second, the NAS must have the ability to access the Ethernet network, that is, it must have an Ethernet card.
Performance comparison of SAN\NAS:
1. Is SAN faster or NAS faster?
First, let’s look at SAN and NAS The path diagram of NAS is as follows:
Obviously, the path of the NAS architecture is replaced by Ethernet and TCP/IP protocols when communicating at the virtual directory layer and file system layer. Memory, this not only adds a lot of CPU instruction cycles (TCP/IP logic and Ethernet card driver), but also uses a vulgar transmission medium (memory is much faster than Ethernet).
In SAN mode, there is one more FC access process in the path than in NAS mode, but most of the FC logic is completed by the hardware on the adapter card, which does not increase much CPU overhead, and FC access The speed is higher than Ethernet, so we can easily conclude that if there is no bottleneck on the back-end disk, then the NAS will never be able to surpass the speed of the SAN architecture unless it uses a faster-than-memory network method to communicate with the host.
But if there is a bottleneck in the back-end disk, then the performance degradation caused by NAS using the network instead of memory can be ignored. For example, in an environment with a large number of random small-block I/O and a very low cache hit rate, the back-end disk system reaches the maximum bottleneck. At this time, the front-end I/O instructions will be in a waiting state, so even if the speed of the first segment of the path is Quickly, it won't help.
At this time, the NAS system is not only not slower than SAN, but also may have higher performance than SAN due to its optimized concurrent I/O design and characteristics based on file access rather than cluster block access.
Since NAS is generally not faster than SAN, why should NAS be born? Since NAS is not as fast as SAN, why does it still exist? The specific reasons are as follows:
#The cost of NAS is much lower than that of SAN. The front-end only uses Ethernet interfaces. The cost of FC adapter cards and switches is very high compared to Ethernet cards and switches.
NAS can solve the CPU and memory resources on the host server. NAS is suitable for CPU-intensive application environments.
Because NAS utilizes Ethernet, it is highly scalable and easy to deploy.
NAS devices generally provide multiple protocols to access data, while SAN can only be accessed using the SCSI protocol.
NAS can realize shared access by multiple clients on one disk array, including simultaneous access to a directory or file. In SAN mode, unless all clients have installed special cluster management software, a certain lun cannot be shared. Forced sharing will damage the data.
The specially optimized NAS system can handle a large number of client requests concurrently, providing a more convenient access method than SAN.
Multiple hosts can mount directories on NFS at the same time, which is equivalent to reducing the processing flow of the file system in the entire system, and converting the original multiple parallel processing to NFS A single instance simplifies system redundancy.
2. Is SAN or NAS better?
The instructions for IO intensive and CPU intensive are as follows.
CPU-intensive: The internal logic of the program is complex and the amount of disk access is not high.
IO-intensive: The internal logic of the program is not complex and does not consume much CPU, but the data on the hard disk can be accessed at any time.
Both IO and CPU are intensive: not suitable for stand-alone, must form a cluster.
Obviously, NAS is much slower than SAN in environments with intensive block sequential IO. The reason is that after a large amount of IO accumulation, the overall difference becomes apparent. However, if you want to use 10G Ethernet, you will undoubtedly choose NAS, because after all, the speed of the underlying link is the fundamental bottleneck of current NAS.
In addition, if it is a high-concurrency random small block I/O environment or an environment with shared access to files, NAS will show strong relative performance. If the file system on the SAN host is heavily fragmented, random small blocks of IO will be generated when reading or writing a file. However, the NAS's own file system has many optimized designs and relatively few fragments. CPU-intensive ones should consider using NAS.
If you want to read more related articles, please visit PHP Chinese website! !
The above is the detailed content of What is the difference between san and nas. For more information, please follow other related articles on the PHP Chinese website!