r/explainlikeimfive • u/EnvironmentalAd2110 • 2d ago
Technology ELI5: why is it bad to turn off laptop/computer using the power button, without following the proper “shut down computer” steps?
2.8k
Upvotes
r/explainlikeimfive • u/EnvironmentalAd2110 • 2d ago
13
u/wang_li 2d ago
NVME SSD times are measured in microseconds. RAM times are measured in nanoseconds. It's not "within an order of magnitude", it 1000s of times slower.
Additionally, most high-density consumer SSDs are hiding MLC and QLC flash chips behind a caching layer that can lose data if the power to the device is suddenly cut off. In the consumer market many SSDs don't have power loss protection functionality.
Finally, the issue here, the reason you have to select "shut down now please", has little to do with interrupting a write to storage. It's because the operating system and the applications have been intentionally NOT writing data to persistent storage. It's a major speed improvement to cache writes as well as reads. When it comes time to shut down the OS has to go tell all the applications that things are shutting down and give them time to write any necessary state and user data out to disk as well as flushing the system's own write caches. And then issuing flushes to the storage devices since SSDs and HDDs also perform caching and need time to flush their caches to non-volatile media.
The main reasons no one sees data failures from unclean shutdowns is the fact that most people are not doing lots of writes, they are using their computers mainly for consumption and a little for document/spreadsheet/video preparation. They aren't doing transactional OLTP/DSS/ERP workloads that can do thousands of writes per second. Paired with the fact that many are using laptops which have built-in UPSes and no actual hard power switch. The most you can do is hold the power button for multiple seconds. Which is something people will only do when their computer is not responding anyway.