Verdict

For a NAS or any RAID array, the ST8000NM017B is the clear pick - it's a CMR drive, while the ST8000DM004 uses SMR recording, which is not recommended for RAID. Only consider the ST8000DM004 for single-drive or archival use.

ST8000DM004 ST8000NM017B
Capacity 8 TB 8 TB
Recording tech SMR CMR
RAID / NAS safe No Yes
Class Desktop Enterprise
Spindle speed 5400 RPM 7200 RPM
Cache 256 MB 256 MB
Noise (idle) 22 dB 28 dB
Fill Air Air
Interface SATA SATA
Failure rate (AFR) - -
Price / TB $31.25 $50.80

Highlighted cells mark the stronger spec for a NAS build. Failure rates from Backblaze Drive Stats where available; $/TB shows once live prices are wired.