4 ms·
Flash is actually super lossy (especially non-SLC technology), it only appears to durably store your data because of error correction and redundancy. This is s
by jrockway 10y ago
Flash is actually super lossy (especially non-SLC technology), it only appears to durably store your data because of error correction and redundancy.
This is something I never realized until I worked on an embedded system where every bit error showed up as a log message. It made me think, "how can computers work at all"? The answer is math and abstraction layers that work a little bit better than the average web framework.
- TickleSteve 10y agowear-levelling and bad-block management are not magic. The failure modes of FLASH are well-known, they dont necessarily need abstraction layers and they do work very well and reliably.
- lallysingh 10y agoI think when someone on HN refers to a specific piece of tech as magic, they're not saying that it's literally magical.
- kabdib 10y agoFlash storage management is still hard to get right, especially when the power can be removed at any time. Making data structures resilient to arbitrary power removal while having good performance is quite a feat.
- jrockway 10y agoI used the word math, not magic. There are many abstraction layers involved. For example, your Linux application isn't bit-banging the NAND chips directly. Your SoC knows there's flash attached, and handles it accordingly. Or, the Linux MTD layer handles it. Then, there are the flash-specific filesystems, like ubifs. All in all I find it pretty interesting, because if you "echo foo > /dev/mtdX", you're not going to find any sequence of flash cells that contain the bit pattern 0x66 0x6f 0x6f 0x0a for very long after you do that write. And yet everything works anyway. There is a _high probability_ that you will be able to read it back, but there it's never guaranteed. Nothing is ever guaranteed. All we can do is increase the probability of success.
- StillBored 10y agoRight, and usually SD cards don't have anywhere the level of FTL's that SSD's have. In fact its likely there isn't much of a FTL at all, rather just a simple ECC on the flash pages. Lose more bits in that page than the ECC can correct, and the whole card is basically done because it can't relocate sectors. SD isn't meant to be primary storage. Its meant to be used more like floppies/usb sticks. I can't tell you how many android phones I "fixed" for a couple years by replacing the SD cards. I actually had a sandisk 128G fail on me a couple weeks ago, that was just sitting in a dell/windows tablet with little more than a few movies copied to it. It didn't last 6 months, I guess something in win10 must have been rewritting a date/time stamp or something similar to the same sector long enough that the card just started hanging doing reads until it became bad enough that windows would choke and I noticed it. Back about 10 years ago, I had an ARM device with an SD slot that I was writing firewall logs to. The SD cards in that machine would last ~2 months before they died. Eventually I replaced the SD cards with a USB attached SSD in an enclosure, and that fixed the problem.
- smhg 10y ago> that work a little bit better than the average web framework you have a reference for this? which aspects did you compare or were compared?
- bendbro 10y agoI think that was intended to be a joke, as when I think of the average web framework, I see buggy junk.