Amazon Interview Question

implement the commit and rollback of database using any existing data structure,living coding