M.2 is a form factor used by SSDs, Wi-Fi cards, network cards, etc. NVMe, on the other hand, is a protocol/interface used by PCIe-based SSDs to read and write data. People are confused between these two, but there is nothing to be confused about. I will clarify that in this article.
M.2 just decides the dimension of an SSD. However, NVMe is a storage protocol made for high-speed SSDs. NVMe does its job of connecting the SSD directly to the CPU through the PCIe interface. NVMe helps PCIe SSDs leverage the PCIe lanes effectively and ensure a high-speed data transfer. NVMe also helps reduce latency and allows parallelism. Because SSDs are already capable of parallelism, NVMe works as a protocol and helps support multiple command queues simultaneously.
Let’s compare both of these and see how they are different.
What is M.2?
M.2 is a compact form factor used by internally mounted expansion cards and SSDs. Originally called the Next Generation Form Factor, M.2 replaced the older mSATA form factor. It came with much compact size advantages and support for both SATA and PCIe interfaces. The width of the M.2 SSDs is always 22mm although the length can vary depending on the device. The most popular M.2 form factor for SSDs is the 2280 (22mm wide x 80mm long). However, there are many other form factors which we’ll discuss below. However, except the SSDs, the other devices using the M.2 form factor can have other dimensions as well.
M.2 Form-Factor Specifications
There are 5 common dimensions of M.2 SSDs i.e. (22 mm×30 mm, 22mm × 42mm, 22mm × 60mm, 22mm × 80mm, and 22mm × 110mm.
M.2 has gained popularity after its great compatibility with the NVMe SSDs. On the M.2 NVMe PCIe slots, generally, 4 lanes are allocated for direct access to the CPU. M.2 ports are compact than the ordinary PCIe slots but also have a limited number of PCIe lanes which is actually enough for the SSDs.
M.2 modules might share the same form factor but there are different connectors types mainly to distinguish the devices. An M.2 device can have B-Key, M-Key, or B+M Key connectors to define the compatibility and supported interfaces. The M-Key connector generally has the highest bandwidth with support for both M.2 NVMe and M.2 SATA SSDs.
B-key and M-key denote the difference in the connector pinout that can support specific types of M.2 devices.
Devices using M.2 Form Factor
There are many types of devices using the M.2 form factors. Let’s discuss all of them.
M.2 NVMe SSDs
NVMe SSDs are the most popular application of the M.2 form factor. These devices use the PCIe interface for data transmission but the data transfer is handled by the NVMe protocol. We will talk about the NVMe later in the article but, for now, we can understand that M.2 provides the physical connection while PCIe gives the lanes for data transmissions. However, NVMe helps utilize the PCIe interface in a better manner. The M.2 NVMe SSDs get more bandwidth with the new PCIe generation just like other PCIe-based devices such as graphics cards. However, the physical form factor and the size of the NVMe SSDs are decided by the M.2 specifications which we say above.
An M.2 NVMe SSD looks like this:
NVMe SSDs are the fastest secondary storage medium available for the end-users. They are expensive but eliminate the storage bottlenecks pretty effectively. M.2 has allowed these drives to be compact. PCIe and NVMe have their role in the enhanced performance and reduced latency in NVMe SSDs.
M.2 SATA SSD
M.2 SATA SSDs is an adaptation of the SATA 2.5″ SSD in the compact M.2 form factor. This saves space and reduces your computer’s weight a little bit. Other than that, the M.2 SATA SSDs have no performance benefits compared to the 2.5″ SATA SSDs. The SATA-3 interface offers a maximum bandwidth of 600 MB/s. So, your M.2 SATA can never surpass this limit. There is a transfer protocol involved in the SATA interface known as AHCI. But, because the SATA has its own limitations, the actual performance is pretty low. However, M.2 SATA SSDs are good for adding huge amounts of storage volume without adding those big SATA 2.5″ SSDs. The price will also be almost similar.
You just saw the M.2 NVMe SSDs above. Here are M.2 SATA and M.2 NVMe side by side. Look at the same form factor but the difference in the connectors.
Wi-Fi and Bluetooth Cards
The Wi-Fi and Bluetooth cards also use the M.2 Form factor. However, there are other more compact dimensions such as 1630, 1216, and 2230 used by these small cards. The connectors can also vary as compared to our M.2 SSDs.
Other common devices using the M.2 Form Factor
Some other devices such as WWAN modules, GNSS modules, ethernet adapters, and TPM cards also use the M.2 form factor. AI and Accelerator modules such as the Google Coral AI accelerator also use the M.2 form factor for edge AI applications. Some NFC modules also use the M.2 form factor mainly in their POS systems and mobile payment devices. USB adapters, interface adapters, and many networking devices also use this compact form factor.
What is NVMe?
NVMe can be called both SSD interface and transfer protocol especially designed for modern high-speed SSDs. NVMe helps these SSDs to take full advantage of the PCIe connections. Some people call NVMe an interface which is partially true because it defines how store devices communicate to the system. But, it is technically inaccurate. NVMe works on top of the PCIe interface and decides how data will be transmitted through the PCIe lanes.
SSDs use the NAND flash memory which has an inherited capability of parallel processing. NVMe helps to achieve the best possible results using the same hardware elements. NVMe itself is a software element or a set of rules that governs the data transfer between the system and the storage devices. NVMe works as a driver and is mainly controlled by the operating system.
Purpose of NVMe in SSDs
The main purpose of NVMe SSDs was to address the limitations of the SATA and AHCI which weren’t suitable for the modern SSDs. In fact, both SATA and AHCI were made for the hard drives which are way slower than the SSDs. Because PCIe already had a very high bandwidth, SATA and AHCI failed to effectively use it with faster SSDs.
NVMe significantly improves the IOPS (Input/Output Operations per Second) by taking full advantage of the PCIe interface. NVMe removes the legacy AHCI overhead and streamlines the command sets. The major benefit is the total steps taken by the CPU to access the data from the SSD are reduced.
The major benefit of the NVMe protocol is parallelism. As an example, the AHCI protocol was able to support only 1 queue with 32 commands. NVMe allows for up to 64000 I/O queues with each queue capable of handling 64,000 commands simultaneously. This high level of parallelism in NVMe SSDs allows for the SSDs to execute many commands at the same time. With thousands of commands running at at time, the storage bottlenecks are reduced, and total bandwidth increases.
NVMe also helps in reducing the latency with the help of direct access to PCIe. This is done with the help of command optimization. NVMe can deliver latency of up to 20ms and even lower than that. The latency with the AHCI protocol was near around 200 microseconds.
Along with the performance benefits, NVMe offers data protection features, effective power management, and namespace support.
Difference between SATA, NVMe, PCIe, and AHCI
Conclusion
I think I have cleared the confusion between the M.2 and NVMe. To conclude, M.2 decides the physical dimensions of an SSD. However, NVMe is an optimization technique to improve the performance of PCIe-based SSDs. Now, NVMe SSDs can have other form factors like the ordinary PCIe in AIC SSDs or the U.2 Form factor in the enterprise SSDs. However, in commercial environments, M.2 is the most common form factor and NVMe is the faster transfer protocol for normal users.
I hope this helps!