Warehouse:

I do believe the best way to keep u stuff safe is to build a good reputation (prestigue,honor,alliance). Beyond that a good defense and army are also useful. However there are two situation where warehouse is essential:
1. When u are under attak and u want to do comforting. U can use either food or sell lumber and do praying. If the guy has enough transporter he can withdraw all u cash and u won't have anything to comfort. I keep the level of warehouse such that I can do a few rounds of comfort withing an hour.

2. If u have negative food production and all u foods are plundered then u city goes to riot and refuge. U lose resource and army. So to prevent this it is good to have a warehouse mostly for food for when u are offline.

******
I also find that a great way to take care of u resources are to have a lot of cheap resources (food). If u have like 10M food and only 2M other resources. Then u are less likely to be attacked compared to the time when u have a higher ratio of gold or expensive resources.

Practically I only keep a single level 9 warehouse for each city (30-40K population). Mostly holding food and lumber