Everything you wanted to know about storage devices.mp3
Technical Guide Objective on HDDs, SSDs, NVMe and removable solutions — performance, reliability and good practices for those who do web and infrastructure.
Hello, I am the author of this space in Yurideveloper. In this article I directly organize the fundamentals, comparisons and best practices for working with day-to-day storage devices of developers and operations teams.
1. Overview and terminology
Storage devices are divided into classes with different characteristics of performance, durability and cost. Below are the main categories you will find in the market and in the development practice:
- HDD (Hard Disks): Mechanics, higher capacity at cost and better cost/GB for archiving. Typical latency between 4 ms and 12 ms, dependent on rotation and cache.
- SATA SSD: solid state drives connected via SATA III (6 Gbps). No moving parts, latency much lower than HDDs (~0.1 ms).
- NVMe SSD: PCIe-connected (usually PCIe 3.0/4.0), with even lower latency and significantly higher IOPS. Ideal for IOPS-sensitive workloads.
- Removable devices: USB Flash Drives, MicroSD/SD, EMMC, and UFS on mobile devices. They offer convenience but with variable durability and performance.
Key concepts: latency, IOPS (input/output operation per second), throughputs (MB/S), TBW (total of recorded bytes), MTBF (average time between faults), and endurance (recording resistance). Understanding these parameters helps scale storage for software applications, databases, or cloud environments.
2. Performance and Architecture
Performance does not depend only on nominal capacity. Architecture, communication protocol and memory type directly influence the usage experience:
- SATA vs PCIE/NVME: SATA offers fixed bandwidth (~6 Gbps), with higher latency; NVME uses the PCIe bus, allowing for greater parallelism and significantly lower latency.
- Flash memory types: SLC (high durability), MLC, TLC and QLC (lower durability, higher density). The higher the density, the greater risk of wear and tear without wear leveling techniques.
- Endurance and Wear: Wear Leveling distributes recordings along the block set. In intense workloads, the choice of memory type and capabilities is crucial.
- IOPS and throughput: random loads (4K) require high IOPS; Sequential loads require high throughput. NVMe usually offers advantages on both fronts.
Practical Summary: For applications with intense random readings/writings (databases, caches) prefer NVMe with sufficient hardening capacity. For archiving or long-term storage with sporadic accesses, HDDs or SATA SSDs can be more economical.
3. Reliability, durability and management
Reliability is governed by metrics that help predict failures and plan maintenance and backups:
- SMART (Self-Monitoring, Analysis and Reporting Technology): Set of attributes that monitor health, temperature and wear and tear of devices. Remember to read SMART periodically.
- TBW/DWPD: Endurance – How much data can be recorded throughout the device’s life without significant degradation. Higher TBW/DWPD indicates greater durability under intensive loads.
- Trim and Garbage Collection: Operations that help maintain SSD performance by managing free blocks. In Linux environments, keeping TRIM active is recommended.
- Power Loss Protection: Cache with protection or reserve batteries help to prevent data corruption in power outages.
Good Practices: Maintain SMART monitoring, feed the system with regular backups, and plan to rotate storage assets based on endurance and temperature metrics.
4. Good usage, formatting and management practices
Some useful guidelines for those who develop, operate or scale storage in software projects:
- Format with 4K-aligned partitioning to reduce overhead, especially on SSDs and NVMe.
- Choice of file systems as appropriate: EXT4/XFS/BTRFS on Linux, NTFS/EXFAT on Windows, APFS on macOS when relevant. Consider features like Cow (Copy-on-Write) and snapshots as needed.
- Automatically activate Trim on SSDs (for example, fstrim -av or configuration in fstab with Discard when applicable).
- Plan periodic backups by testing data restoration. Redundantly storing data prevents catastrophic failures.
- Consider the logical organization of data for backups: retention policy, encryption and access controls.
Simple configuration scenario example: Keep an EXT4 partition on NVMe for the system and a second SATA/HDD SSD partition for data with weekly incremental backups.
reference code
This Bash snippet helps to list available block devices and check the status of S.M.A.R.T. when there is support. Use with appropriate (sudo) privileges if necessary.
# List block devices and SMART status (when available)
#!/bin/bash
Set -Euo Pipefail
echo "Block devices available (discs only):"
lsblk -d -o name,size,type,model
echo
if command -v smartctl &>/dev/null; then
echo "Status S.M.A.R.T. (if supported):"
for dev in /dev/sd? /dev/nvme?n? /dev/hd?; of
[ -b "$dev" ]|| continue
# Checks basic health and prints the first line of SmartCTL health
smartctl -h "$dev" 2>/dev/null | head -n 1 || true
done
else
echo "Smartctl is not installed. Install smartmontools to query s.m.a.r.t."
phi
How do you like it? Take the knowledge forward
This is just the beginning. Explore more technical content in YuriDeVeloper to deepen performance, storage and infrastructure topics. I recommend the articles below:
Sou Apaixonado pela programação e estou trilhando o caminho de ter cada diz mais conhecimento e trazer toda minha experiência vinda do Design para a programação resultando em layouts incríveis e idéias inovadoras! Conecte-se Comigo!