I originally asked this in a Facebook group for the Raspberry Pi, and on the Raspberry Pi StackExchange, but they keep latching onto the "standard" method of making a "RAM drive" inside of the operating system. That's not what I'm looking for.
I don't trust a solution that needs to thrash the card a lot before it figures out that it shouldn't thrash the card.
So: Is there a hardware device that plugs into a standard microSD slot and works like a standard microSD card, but reverts to a captured image of itself when it loses power?
Similar to this question, except that my system will be inaccessible. So I can't remove the card, re-image it elsewhere, and re-insert. The card itself has to do that automatically. (or whatever it is that connects to the card slot)
In terms of functionality alone, you might look at the Immutable flag in VirtualBox. It relies on VB's "snapshot" functionality, which uses a base image and a difference image. The base image is read-only, and all writes go to the difference image. Reads go to the difference image first, and then to the base image if not found. To revert, simply delete the difference image.
Storing the difference image in some on-card RAM would be a convenient way to revert on power loss, like I'm looking for. The system that uses the card remains unchanged. It can write to the card and read back what it just wrote, so long as there hasn't been a power loss in between.
Another way to do it could be to have an equal amount of on-card RAM as it has flash. When power is first applied, copy the flash into the on-card RAM, and then run entirely from the on-card RAM. Again, the system has no idea that this is happening, and simply uses the card as usual.
A brute-force method could be to have twice the amount of flash as advertised, and use half of it to re-image the other half. This has the disadvantage of wearing out the flash cells faster than usual because all of them (in the working set) get erased and rewritten on every power cycle in addition to the normal use.
Regardless of how it actually works, is there a device that has this external functionality? Use it like a normal microSD card, then capture an image of itself and continue to use it normally...except that it now reverts to that captured image on a power cycle?