Recall & Review
beginner
What is a transaction in database terms?
A transaction is a group of operations performed as a single unit. All operations must complete successfully, or none are applied, to keep data correct.
Click to reveal answer
intermediate
What does ACID stand for in transaction handling?
ACID means Atomicity, Consistency, Isolation, and Durability. These are rules to make sure transactions work safely and correctly.
Click to reveal answer
intermediate
Why is isolation important in transactions?
Isolation keeps transactions separate so they don't interfere with each other. This avoids problems like reading wrong or partial data.
Click to reveal answer
beginner
What happens if a transaction fails during execution?
If a transaction fails, all changes made during it are undone (rolled back) so the database stays correct and unchanged.
Click to reveal answer
advanced
How do you start and end a transaction in GraphQL with a database?
You start a transaction by telling the database to begin, then run your operations, and finally commit to save or rollback to undo if errors happen.
Click to reveal answer
What does the 'Atomicity' property ensure in a transaction?
✗ Incorrect
Atomicity means the transaction is all or nothing: either all steps succeed or none are applied.
Which of the following is NOT part of ACID properties?
✗ Incorrect
Indexing is a database optimization, not an ACID property.
What does 'rollback' do in transaction handling?
✗ Incorrect
Rollback reverses all changes made during the transaction to keep data safe.
Why is isolation important when multiple transactions run at the same time?
✗ Incorrect
Isolation keeps transactions separate so they don't affect each other's data.
In GraphQL, how do you ensure multiple database operations are treated as one transaction?
✗ Incorrect
You explicitly start a transaction, perform operations, then commit or rollback to keep data consistent.
Explain the ACID properties and why they matter in transaction handling.
Think about how each property helps keep data correct and reliable.
You got /5 concepts.
Describe the steps to handle a transaction in a GraphQL API connected to a database.
Consider how you control the database actions inside your GraphQL resolver.
You got /4 concepts.