Recall & Review
beginner
What is lazy loading in Flask SQLAlchemy?
Lazy loading means data is loaded only when you access it. It delays fetching related data until you actually need it, saving resources initially.
Click to reveal answer
beginner
What does eager loading do in Flask SQLAlchemy?
Eager loading fetches related data immediately with the main query. It loads everything upfront to avoid extra database calls later.
Click to reveal answer
beginner
Give a real-life example to explain lazy loading.
Imagine a photo album app. Lazy loading means photos load only when you scroll to them, saving data and time at first.
Click to reveal answer
intermediate
Why might eager loading be better than lazy loading sometimes?
Eager loading is better when you know you will need related data soon. It avoids many small database calls, making the app faster overall.
Click to reveal answer
intermediate
What is a downside of lazy loading?
Lazy loading can cause many small database queries if you access related data repeatedly, which can slow down your app.
Click to reveal answer
In Flask SQLAlchemy, when does lazy loading fetch related data?
✗ Incorrect
Lazy loading delays fetching related data until you actually access it.
Which loading strategy fetches all related data upfront in Flask SQLAlchemy?
✗ Incorrect
Eager loading fetches related data immediately with the main query.
What is a common benefit of lazy loading?
✗ Incorrect
Lazy loading saves resources by delaying data fetching until necessary.
When might eager loading improve performance?
✗ Incorrect
Eager loading is good when you know you will use related data soon.
What problem can lazy loading cause if related data is accessed many times?
✗ Incorrect
Lazy loading can cause many small queries, slowing down the app.
Explain the difference between lazy loading and eager loading in Flask SQLAlchemy.
Think about when data is fetched and how it affects app speed.
You got /3 concepts.
Describe a situation where you would prefer eager loading over lazy loading.
Consider how many times you access related data.
You got /3 concepts.