System Design · Senior · Question 35 of 75
Why is the search index often updated asynchronously rather than in the same transaction?
- ✓Correct answer: So DB writes don't depend on search; the cost is a delay
- 2Search engines don't support writing data at all
- 3Transactions are forbidden when working with text data
Explanation
Changes are fed into the index via a queue or CDC (change data capture). The main operation is fast and reliable, and search catches up within seconds - eventual consistency. The UI must be ready for this (e.g. show just-created items from local state).