# The Pinky Swear (Transactions)
In the world of the Lazy Elephant, a **Transaction** is the ultimate organizational tool for chaos.
Imagine you are moving money from one pocket to another. You have to take the coins out of the first pocket (UPDATE #1) and drop them into the second pocket (UPDATE #2).
If the elephant gets distracted halfway through—perhaps by a particularly interesting peanut—and forgets to finish the second part, the money simply vanishes into the digital void. This is unacceptable.
To prevent this, the elephant uses Transactions: a **Pinky Swear** that a set of actions is one single, indivisible "Unit of Work."
## The Private Room (Isolation)
When you start a transaction, the elephant leads you into a **Private Room**.
While you are inside that room scribbling on your stone tablets, nobody else in the entire warehouse can see what you are doing. Thanks to [[MVCC]], you are working on your own private "versions" of the data.
If ten other elephants are looking at the warehouse, they still see the old version of your pockets. They have no idea you are currently moving coins around. This is **Isolation**. It prevents other people from making decisions based on your half-finished, messy work.
## All or Nothing (Atomicity)
Eventually, you reach the end of your task. You have two choices:
1. **COMMIT (The Grand Reveal):** You step out of the room, yell "I'm done!", and the elephant officially records the end of your work in the [[WAL#The Sequential Scribble|Pocket Diary]]. Instantly, your new versions become the "Truth" for everyone else.
2. **ROLLBACK (The Big Etch-A-Sketch):** You realize you made a horrible mistake. You grab the elephant's trunk, shake it, and scream "Never mind!" The elephant immediately throws your messy private tablets into the trash and pretends you never even entered the room. The warehouse remains exactly as it was before you arrived.
This is **Atomicity**. To the rest of the world, your work either happened completely or it didn't happen at all. There is no "halfway."
## The Performance Tax
Pinky swears aren't free.
While you are in your Private Room, you might be holding onto a [[Lock]] for a specific filing cabinet. If another elephant wants to edit those same coins, they have to sit in the hallway and sigh heavily until you either Commit or Rollback.
The longer you stay in your Private Room (Long-Running Transactions), the more elephants pile up in the hallway, and the more likely the whole warehouse is to grind to a halt.
Being lazy means making big promises (Transactions), but being a *good* lazy elephant means finishing those promises as fast as possible so everyone else can get back to their own naps.