Exercise 2: Why This Course Needs Debouncing and the Firebase Course Didn't — Possible Solution ==================================================================== THE ACTUAL UNDERLYING DIFFERENCE ------------------------------ This course's search_items view queries the real database on every single request it receives - each keystroke that triggers a search means a genuine network round-trip and a fresh database query. The Firebase sibling course's own chosen search approach instead loads the entire item history once, when the component first mounts, and filters that already-loaded array in plain JavaScript on every keystroke afterward - no network request happens per keystroke at all in that approach. WHY THIS DIFFERENCE DETERMINES WHETHER DEBOUNCING IS NEEDED ------------------------------ Debouncing exists specifically to avoid firing an expensive operation (here, a network request hitting a real database) on every single keystroke. Since this course's search genuinely triggers a new database query per request, sending one on every keystroke without debouncing would hammer the server unnecessarily as someone types quickly. The Firebase course's own approach has no per-keystroke network cost to avoid in the first place, since filtering happens entirely in memory against data that's already loaded - there's nothing there for debouncing to protect against. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly identifies that this course's search hits the database on every request while the Firebase course's approach filters an already-loaded array in memory, and correctly explains that debouncing is needed specifically to avoid the real, repeated cost of a per-keystroke database query that this course's architecture actually has and the other one doesn't.