Saving integer data after power shutoff

Sure, that will work. The Arduino can shut itself off after a delay, if you use a transistor or something like the convenient Pololu Power Switch: https://www.pololu.com/product/2808

In case of power failure, many people use a large capacitor to power the Arduino, which gives it enough time to save a few bits of data before expiring. Search with phrases like "Arduino power loss backup" to find some examples.