There’s several options for you here and you can try testing them and checking your server logs to see what’s requiring more workload.

Setting a database trigger on the backend is a valid option. The trigger could watch for any changes to restaurant review ratings, then trigger a backend event to update the respective restaurants avg rating if there’s a change.

In the cases I’ve tested database triggers, they have typically been more expensive on workload than triggering an event based on a user action.