If the database system is carefully written, there should be no point in time when a power outage can ruin the data, and when a power outage occurs, no committed data will ever be lost.
rdbms first writes data to the transaction log before actually updating the data. After a failure, it repeats the log, copies any pending changes from the log to the database, and rolls back any transactions that were not completed in the log. Commit is considered successful only after the hard drive reports a completed logging operation.
source share