How does NVMe work?
Non-Volatile Memory Express (NVMe) is an interface protocol designed to standardize the use of PCI Express (PCIe) communications with solid-state drives (SSDs). Its development came about when high-speed SSD adoption accelerated as component costs dropped, and namely to address the new use of the faster PCIe memory channel over the use for SATA/SAS interfaces (which were designed for the existing HHD-based enterprise storage systems).
Because PCIe slots connect directly to the CPU, PCIe channels provide the better choice over SATA/SAS for accessing SSD memory. Taking early advantage of this before NVMe, many vendors produced proprietary firmware that, while exploiting the increased memory speed, still had several scaling challenges including maintaining firmware across all systems, incompatibilities between devices and firmware, inefficient memory processes because of low maturity of firmware, and lack of value-adding enterprise features. The greater memory access gained in these early protocols, however, further fueled the development of NVMe, which would overcome these challenges.
According to the official specification, NVMe was developed from the ground up for SSDs, and introduces several features that makes a more efficient interface, lowers latency, and enables scalability. How it works is through the introduction of several interface and architectural features that ease how host software communicates with non-volatile memory across multiple channels.
"The NVMe architecture brings a new high performance queuing mechanism that supports 65,535 I/O queues each with 65,535 commands (referred to as queue depth, or number of outstanding commands). Queues are mapped to CPU cores delivering scalable performance. The NVMe interface significantly reduces the number of memory-mapped input/output commands and accommodates operating system device drivers running in interrupt or polling modes for higher performance and lower latency. The NVMe specification also contains host-to-device protocol for SSD commands used by an operating system for: read, write, flush, TRIM, firmware management, temperature, errors and others." nvmexpress.org