I have to develop a Java application that has to read some files on the network, edit them and put them back.
The problem is that I always did (over the network) file operations through the FTP protocol. But, I recently heard about Webdav which is HTTP based.
Did anyone notice a difference (in terms of speed) between them ? Which one is the best ? Why did they "invent" Webdav if the FTP is good for that?
WebDAV Versus FTPThe WebDAV server is much easier to use than a typical FTP server since you access the remote file server as a standard drive. WebDAV is a more modern protocol than FTP and can be seen as the successor to the FTP protocol.
In many of its use cases, WebDAV is being supplanted by more modern mechanisms. But it's still a reliable workhorse when the right servers and clients are matched, so it's still encountered in many different applications.
FTP is extremely fast and efficient compared to SMB when transferring large files. It can be difficult when it comes to small files, but overall, the speed of the FTP file transferring protocol is better. The use of short messages in SMB makes it sensible to network latency, which can decrease the speed.
The two most commonly used alternatives to the WebDAV protocol are FTP and SFTP: FTP (File Transfer Protocol): Simple network protocol that allows the transfer of files in computer networks; can be combined with SSL/TLS (FTPS) for secure data traffic.
WebDAV has the following advantages over FTP:
By working via one TCP connection it's easier to configure it to bypass firewalls, NATs and proxies. In FTP the data channel can cause problems with proper NAT setup.
Again due to one TCP connection, which can be persistent, WebDAV would be a bit faster than FTP when transferring many small files - no need to make a data connection for each file.
GZIP compression is a standard for HTTP but not for FTP (yes, MODE Z is offered in FTP, but it's not defined in any standard).
HTTP has wide choice of authentication methods which are not defined in FTP. Eg. NTLM and Kerberos authentication is common in HTTP and in FTP it's hard to get proper support for them unless you write both client and server sides of FTP.
WebDAV supports partial transfers and in FTP partial uploads are not possible (ie. you can't overwrite a block in the middle of the file).
There's one more thing to consider (depending on whether you control the server) - SFTP (SSH File Transfer Protocol, not related to FTP in any way). SFTP is more feature-rich than WebDAV and SFTP is a protocol to access remote file systems, while WebDAV was designed with abstraction in mind (WebDAV was for "documents", while SFTP is for files and directories). SFTP has all benefits mentioned above for WebDAV and is more popular among both admins and developers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With