If you know that it takes a week to acquire or harvest food and distribute it to the population, then make sure you always have a weeks worth of food in the granary. You also know that droughts and invasions are a fact of life, so plan accordingly.
While your thoughts are admirable and well-intentioned, what you suggest normally isn't possible. "Make sure you have food" is all well and good, but when your realm doesn't produce enough, and no one will sell, you can't very well "make sure you have enough". You simply cannot buy what isn't for sale. Similar situation with drought. If you don't produce enough to stockpile, then you can't create stockpiles to get you through the tough times.