SMB vs NFS vs AFP vs iSCSI - What are they and which should you use

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right how's it going y'all today we're going to be talking about the difference between smb afp nfs and iscsi basically all different protocols you can use on a nas to get files on your computer into different computers and i know it's kind of confusing because there's a lot of different options out there in a sense they all kind of do the same thing but we're going to go over the differences and which one is right for you all right so before we start this video i just want to go ahead and save everybody's time if you are a home user and you really are just setting up a nas for the first time and you just need a way to get your files on your computer honestly if you have windows mac or linux the protocol i would recommend is smb it is by far the easiest and it works the best for most home users case i would really just recommend that and so if you just came here for looking for that video go ahead and use smb as long as it's smb v3 and you will be perfectly fine it is a good protocol and it is supported across all operating systems and even stuff like ios and android all have good well-working smb clients and so you'll be able to use pretty much anything with an smb server on linux it's called samba but it works the exact same way it's essentially an emulated clone of smb all right and so now with that out of the way let's go ahead and go into each of the four protocols and kind of talk about what they're good at and what they're not good at so first we'll go ahead and start off with smb smb was originally a windows protocol and so sometimes you'll also see it referred to as cifs cifs is actually smb version one then smb version two and three really built off of this and offer significant performance increases compared to smb version one especially so i would really not recommend running smb version one because it also does have a couple of security vulnerabilities smb is a decent protocol but what it really excels at and why i really recommend it for everybody is it just works with everything where it really excels is compatibility if you're on windows if you're on mac if you're on linux if you are on iphone if you're on ipad if you're on android even if you're on google you're going to be able to connect to a smb server because everybody has a built-in client for it it is just by far the most supported and it is pretty close to the industry standard for just a file based server its speed is really tuned for large sequential read and write which for home users you're doing 99 of time when you're noticing speed it's not that often that home users are having to write thousands of one kilobyte files to a nas but instead you're probably going to read or write a 10 or 20 megabyte file or a 10 or 20 gigabyte file and that's where smb really shows its strength is it's really good in those sequential reads where you transfer a big file from one place to another then there's afp afp stands for apple file protocol and as you consume from the name it is a mac os written application and for macs going to a mac server it was actually really fast and worked great it had a lot of great features that were very well incorporated into mac os and it offered actually faster speeds than smb for a really long time for large sequential transfers it was tuned really well and honestly its performance was awesome on mac os the problem is apple has deprecated the protocol they have pretty much said you know what well everybody's going to smb we're not going to support this extra standard just because we need to and especially since they stopped making those apple servers there's really no reason to use afp from my testing afp can actually be a little bit faster hardly noticeably than smb if you've not tuned the smb server on mac os for a sequential reader write but the thing is it is deprecated apple has said we're no longer going to support the protocol we're no longer going to add features to it or security into it and so that's why it's really just not a good idea to run an afp server anymore there's also some talk of there might be some incompatibilities with the linux version of afp there's a few different options and i have heard of i've never seen of possible file corruptions through the fact that linux which synology is running has to actually emulate the afp protocol because it is not built in like it is on mac os this is the same way that they have to emulate smb with samba but i have heard of a couple of maybe it's not perfect issues so honestly i would not recommend using it unless you're on a mac to mac environment and even then it's probably not even worth it considering how smb will give you essentially the exact same performance without any of these issues and it is so much more compatible with the entire broad ecosystem i really hope in the future nas manufacturers stop saying hey if you use mac use afp and instead just get everybody on smb obviously they should still keep supporting afp while they can because there are a couple of things that are only working afp for mac os but for the broad suite of users they should probably go on smb next up there's nfs and nfs is a really interesting one here because it can be incredibly fast and incredibly slow depending on how you implement it and how well you're able to tune it for your exact needs nfs is a linux to linux protocol there is an nfs client on mac os but quite frankly it's not very well thought out and it doesn't work great if you need it it's there but quite frankly i've always had trouble getting tuned right and it's really just not been worth it for me to go nfs nfs is perfect for enterprise users enterprise users who need to have massive file servers who are all linux backends who need to be able to share small tiny files with each other with ultra low latency it is significantly more difficult to set up than smb for both permissions and also for overall performance but if you do get it tuned just right for linux to linux file system it is incredibly fast for ultra small file transfers so this is the case where maybe there's a virtual machine running you can actually use that virtual machine's back end to be an nfs server now any kind of operating system is going to have absolutely tiny read writes but thousands of them all at the exact same time and so this is where nfs really excels then if you tune nfs just right and i've always had trouble getting nfs really fast i've heard of 4 gigabytes per second being able to be transferred using nfs using a sequential read which is absolutely insane but the thing is you've got to have all the infrastructure tuned just right for it if you really need nfs you probably know what you're doing and can manage it but for the average home user i would not recommend setting it up unless it's to mess around with and you really know what you're doing permissions wise it's a lot more difficult than the good old smb authentication where you just have a user and you say the user can access this folder or not in fs you're having to use unix file permissions which if you're set up for that is not too bad but it doesn't have the same level of security by default that smb does and finally there's iscsi iscsi is completely different than the last three the last three were known as what's called file based sharing iscsi is part of block based sharing so the past three protocols were file based sharing this means that the files are actually stored on the nas and when your computer asks for a file it's actually asking for the file that means that you can have multiple people editing them and it just works really easily your nas knows what files are on there and how they're organized and can give them out and everything like that this is good for larger transfers and having multiple people collaborating all together all having access to a centralized repository but where it is not that great performance of an nfs if you can tune it right is the ability to have ultra small read and write like native disk speeds that is where iscsi comes in iscsi is block based storage block based storage is essentially your nas creating a virtual hard drive and giving whatever computer accesses it over iscsi direct access to it so if the computer would say okay i want to write this file to this section of the hard drive it is just going to do that and your nas is going to handle the rest it is ultra fast for virtual machines because they need direct disk access and it doesn't have to have as much at the overhead of saying okay well let's make sure that nobody else is messing with this file and everything like that because it's just a disk it is just a block of data and nobody else has access to it in iscsi you essentially have one computer accessing the disk at once there's no sharing there's none of that in some very complicated setups you technically can but for almost all implementations you essentially just have every single computer or in most cases virtual machine connect directly into that disk and that way you don't have to have all the overhead of saying okay is somebody else accessing this file hey let's grab the entire file instead what you've got is you've got your nas acting like a external hard drive to your computer every time your computer says i want to write data it is almost identical to writing data as if you plugged in a hard drive to it and so applications that need ultra low latency but only need one person being able to access them at a time iscsi is great it is a little bit hard to work with on mac but there's a good initiator on windows that a lot of people use so for example you can't put your steam library on an smb share steam won't let you because of issues with latency and lag and things like that but what you can do is you can instead mount an iscsi drive so all your data is actually stored on those nas drives but to your computer and all the programs running it it is just like any other hard drive and so you can put all your steam games on this iscs drive and be able to access them over the network without having to have bulk storage on your computer connected directly so there are some real use cases to use iscsi but they're very specific instances and you really gotta know what you're doing because you can end up corrupting files you've got to make sure to eject the disk and things like that versus smb where it's just like eh it'll work pretty much without you really having to do a ton of things and so the other really cool thing about iscsi and why it's actually used a lot in industry rather than actual physical storage devices is the fact that iscsi is still controlled by the nas so if you're running zfs or btrfs you can still use snapshots and deduplication and compression all in line on these disks the other thing is it's not tied to a single machine and so in a highly virtualized environment what you'll have is a ton of different servers all acting as virtual machine hosts then you'll be able to have one or two nas devices that are acting as all the storage for the virtual machines it does come with increased latency and not as fast speeds but it gives you so much more flexibility say one server needs to be taken down for maintenance you can live migrate that disk over and actually have that virtual machine running on another node all without having any downtime whatsoever because all the storage is kept at the nas level and so all the virtual machines are not tied to a single box and they can be migrated as needed and the other thing is since the all the storage is controlled in one centralized location it makes it really easy to make sure backups are being done properly and be able to restore them to other places rather than having to have it configured on every single server and so also with this you can easily grow the size of virtual machine storage pools so if a virtual machine starts needing more data you can simply give it more storage space and the ones who are not using all their data will probably be easily compressed by zfs or btrfs and so it's only really using the data that you're actually using and so it's a really great setup for industries all right well that's going to be it for this i hope this really helped explain how the different protocols work and why there are certain protocols for certain things and really for most users smb is probably going to be the easiest thing to do unless you need some very specific things and so then you would use iscsi once again if you really know what you're doing and you crazy performance nfs is probably where you're going to go but you're probably not watching this video if you're in one of those environments all right well that's going to be it for this tutorial go and leave any other tutorials you like see me make in the comments below and if you want to start sponsoring the channel there's a link for that all right have a good one bye [Music] you
Info
Channel: SpaceRex
Views: 7,129
Rating: undefined out of 5
Keywords:
Id: JXASmxGrHvY
Channel Id: undefined
Length: 12min 22sec (742 seconds)
Published: Tue Sep 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.