For me there is only one rule:
Any data acquisition should run at interrupt level (i.e. elevated priority) and disk access should be done in loop() (i.e. in the background)

This implies: data...