HACKER Q&A
📣 bsldld

What are various strategies for database rollback?


How do you rollback updates to database if an error occurs during runtime? What are the different strategies available to handle this situation?


  👤 karmakaze Accepted Answer ✓
Off the top of my head

1) simple transactions--commit all or none of statements from 'begin/start transaction' and 'commit/rollback'

2) like (1) but with support for nesting

3) like (2) but simulated with snapshot restore points

4) everything is saved all the time but you mark which saved things are complete and actionable/visible, e.g. sagas.

maybe others?

Edit: stored procedures can also be useful as they can easily be retried