Transaction
A group of database operations counting as one: all happen or none do.
Example
A transfer subtracts $100 from one account and adds it to another, in 1 single transaction.
Test yourself: Transaction
Transactions
What is a transaction?
Subtracting $100 and adding $100 are 2 operations; in 1 transaction, both happen or neither.
Transactions
When a transaction is terminated, the system is ready for a new one.
Terminated is the last of the 4 states on the happy path: the database is consistent.
0/2
â–¶ PlayLessons that use it
SQL or NoSQL
Picking the right database
ACID and BASE
Two promises about data
Transactions
All together or nothing
Distributed transactions
Everyone commits or nobody does
Sagas
Steps that can be undone
Monoliths and microservices
1 block or many pieces
Event-driven architecture
Announcing what happened
Idempotency
Repeat without breaking anything
The design steps
From data to bottlenecks
Designing Uber
10 million rides a day
