What to choose for storage for your server. HDD, SSD, NVMe?
Whenever you’re choosing a server for your project probably one of the main aspects is the storage and before we can even speak about RAIDs we always think about what kind of storage to choose. Because there is always a catch when choosing it and whether your project or a website does really benefit from all that speed that storage can offer.
The thing is, choosing storage is similar to choosing a vehicle. You cannot say that trucks are not needed. Perhaps driving to the supermarket might be overkill but if you wish to move tons of stuff nothing beats the truck. The same goes for storage, each one is designed for its own needs.
In this article, we will explain all pros and cons of these types of storage and how to choose them.
Types of storage
HDD: Hard Disk Drives
The Hard Disk Drive is, even today, the main way to store data on a computer. Even with the existence of the SSD, the current replacement for the HDD, they reign in most desktop and notebook PCs. The operating system is stored on the HDD, that is, your Windows, Linux and even Mac OS. In addition to the system, all programs are also saved on the HDD. Also, it is very likely that you save all your photos, music, videos, and documents on your machine's HDD.
The hard drive uses a magnetic platter to store the data. These platters are divided into several sectors and tracks that hold the countless bytes that make up our files. A mechanical arm travels across the entire area of the magnetic disk, reading the files that are requested by the user or operating system. As you can see, an HDD is a fundamental item in any computer. Because it is a very old component, HDDs have already reached a certain plateau of evolution. Therefore, today there are no big differences in quality between an HDD from one brand and another. However, over the years, some manufacturers have stood out and managed to survive for decades producing quality HDDs.
Even right now companies tend to develop new kinds of HDDs that become quite close to the speed of SSD. No kidding, the freshly announced Seagate Exos 2X18 can really match the speed of SATA SSD.
SSD: Solid State Drives
SSD (Solid State Drive) is a hardware component that replaces the old HDD as the data storage drive in PCs. Slowly but really overcoming. Much faster, the SSD has no physical disks or magnetic needles, being able to access data in a fraction of a second and make your computer faster to open programs and perform tasks. Because they have no moving parts, SSDs solve the speed limitation of HDDs, which use read and write heads to perform operations on magnetic disks. In recent years, the significant drop in price per gigabyte has made the SSD a considerable (and perhaps most important) upgrade to improve the performance of any computer.
Flash memory holds all files and, unlike the magnetic disks of HDs, it requires no moving parts or motors to operate. All operations are done electrically, making read and write operations faster, as well as making the drive quieter and more resistant to vibration and drops. The controller manages the data exchange between the computer and flash memory. Comprised of a processor that performs various tasks on the drive, it is one of the main drivers of SSD performance. The chip can manage file read and write cache, encrypt information, map faulty parts of the SSD to prevent data corruption, and ensure a longer flash memory lifespan.
NVMe: Non-Volatile Memory Express
When it comes to achieving faster data read and transfer speeds, SSDs are a more interesting alternative than HDDs. However, SATA-type connections offer technical limitations to which the industry had to look for alternatives.
The solution found was to use the PCI Express interface, which is cheaper and practical. From it, the industry thought of a new protocol that represented an evolution in relation to AHCI, created in 2004. The solution to this problem was presented by a consortium of companies, named NVM Express Organization. This group is formed by about 80 companies, including giants such as Intel, Microsoft, Samsung, SanDisk, and Seagate. Together they developed the Non-Volatile Memory Express (NVMe) interface, thinking exclusively about SSDs.
Among the main advantages of this interface, we can highlight the low latency and better use of CPU cores. To have an idea, the AHCU standard reaches peaks of 6.0 microseconds while NVMe can reach 2.8 microseconds on average. With regards to the CPU, the previous standard generated bottlenecks in the cores in relation to the IOPS (Input/Output Operations Per Second) limit.
As a result, there are benefits for both enterprise and home use of the technology. In the case of enterprises, the advantages appear when we talk about working with heavier loads, which suffered from the limitations of SATA and AHCI standards. For home users, the reduction in power consumption is the most noticeable factor, in addition to performance improvements when combined with multicore processors.
Why NVMe is so fast?
NVMe was designed from the ground up specifically for SSDs to improve throughput and IOPS while reducing latency and increasing overall NVMe SSD speed.
Today's NVMe-based drives can theoretically achieve transfer rates of up to 32 GBps, but the practical maximum is a transfer rate close to 7 GBps. At the same time, latency rates continue to drop. Many drives achieve rates below 20 microseconds (µs) and some below 10.
The older protocols don't work as well on SSDs. Today's SATA-based drives can achieve transfer rates as low as 6 Gbps, with IOPS as high as 100,000. Latencies typically exceed 100 µs, although some newer SSDs can achieve much lower latencies.
SAS drives offer slightly better performance; they provide transfer rates of up to 12 Gbps, and IOPS averaging between 200,000 and 400,000. Still, lower IOPS are not uncommon. In some cases, SAS latency rates have dropped below 100 µs, but not by much.
One reason for this is that NVMe uses a more simplified command set to process I/O requests, which requires less than half the number of CPU instructions generated by SATA or SAS. NVMe also has a much more extensive and efficient system for queuing commands. SATA and SAS support only one I/O queue at a time. The SATA queue can hold up to 32 outstanding commands and the SAS queue can hold up to 256. NVMe can support up to 65,535 queues and up to 64,000 commands per queue.
Despite the advantages that NVMe offers, the protocol is limited to individual hosts. While this can be useful in some scenarios, many organizations are looking for distributed systems that they can deploy in their data centers. For this reason, NVM Express has developed a second specification: NVMe-oF.
The new standard was published in June 2016 to extend the benefits of NVMe across network systems such as Ethernet, InfiniBand, and Fibre Channel. The organization estimates that 90% of the NVMe-oF specification is the same as the NVMe specification. The main difference between the two is the way the protocols handle commands and responses between the host and the NVM subsystem.
The NVMe protocol maps commands and responses to the host's shared memory. The NVMe-oF protocol facilitates communication between the NVMe host and the network-attached NVMe storage device. The new protocol extends the distances that NVMe devices can be accessed within the data center while making it possible to scale to many devices.
The NVMe-oF specification originally provided two methods for communication. The first uses RDMA to support mesh connectivity, such as InfiniBand, RDMA over Converged Ethernet, and the Internet Wide Area RDMA protocol. The second approach is specific to Fibre Channel transport and includes Fibre Channel and Fibre Channel over Ethernet meshes.
In 2019, NVM Express released the NVMe-oF 1.1 specification, which added support for TCP. NVMeMe over TCP makes it possible to use NVMe-oF on standard Ethernet networks without the need to make hardware or configuration changes. The new standard helps bridge the gap between DAS and SANs, while bringing NVMe-oF closer to becoming the de facto standard for enterprise storage.
Ultimate guide on what to choose
After reading all that historical part let’s switch to something specific like what to choose for your project.
HDD: the cheapest yet durable
Unless you really require any IOPS or read-write speed, or your blog doesn’t have too many visitors, go with HDD. They may be slow compared to SSD or NVMe but your visitors won’t notice it. Unless you really require this speed HDD would be more than enough.
SSD: great and fast
Before the NVMe appearance we could say that SSD was the ultimate storage solution but today it is not. Whenever you need an allrounder solution for your requirements goes with SSDs. Plus SSDs have become relatively cheap compared to HDDs, so if you have a few spare bucks to spend on your server, go with SSDs.
NVMe: Ultimate storage solution
NVMe is your way to go when you have an excessive budget, and certain requirements for IOPS for databases or various SaaS apps. The more the merrier so NVMe would be a great fit for any kind of project especially when you need to work with big single files.
As we have mentioned before, everything depends on what kind of project you plan to run on your server. If it would be a small website then it would be better to go with HDD and then gradually advance to the next type of storage if you would see any kind of problems. We hope that this article was indeed interesting for you and it helped you to expand your knowledge about storage types. Make sure to contact BlueVPS and buy the VPS you need.