Efficient way of writing to flash memory without losing data
FLASH is cheap and provides lot of memory, but comes with the cost of sector erase. So you might want to use EEPROM instead. 

Of course it is possible to overcome this flash limitation with some clever software, which tracks the bits and bytes with a journal (i.e. you don't overwrite a byte value but write a new copy of it and note in the journal that the new byte is the recent one). But this is a really big software overhead and you might not want to do that.