How safely write to SD or Eeprom on Arduino power off
I think a &quot;small&quot; capacitor here is not going to do the job as you need to keep power stable until the write is completed.  You need to determine:

How much power am I using?
How quickly can I detect a power outage?
How much time do I need to keep power on the Arduino to complete the write operation(s) I want to complete.

Then you will be in a position to calculate how much capacity you need and whether a capacitor or battery is more appropriate.