← Graph

Should touch on belongs_to be avoided in complex apps?

question 2 connections

Audience member argues callbacks and touch in ActiveRecord should be removed in complex apps because touching parents across has_many updates can cause many parent writes. Speaker counters that touch is fine for typical sizes and remains the best way to keep fragment caches in sync; remove only in real edge cases like touching a million records.

answer_summary
Keep touch for typical has_many sizes — it's the best way to sync fragment caches. Remove it only for true edge cases (e.g. touching millions of rows).
question Should touch on belongs_to be avoided in complex apps?
about
Directly challenges the touch recommendation.
question Should touch on belongs_to be avoided in complex apps?
asked_at
Audience Q&A challenge about ActiveRecord callbacks.

Provenance

Read by
4 extractions