Similarly one may ask, do you lose your house in whiterun If you join the Stormcloaks?
Breezehome is untouched by the stormcloaks so it should be fine. You will however have to talk to the yarl about becoming thane and stuff. But other than that you will not be sleeping on whiterun's streets.
Similarly, what happens if you fail to protect whiterun? If you fail to defend the barricades, you will have to fall back and defend the drawbridge instead. Failing to defend the drawbridge has little consequences, as the quest is impossible to fail unless you die. There will be a percentage count of how many Stormcloak soldiers are left.
Beside this, can whiterun side with Stormcloaks?
You can not continue with the Stormcloak quest. Attacking (Stormcloak) or defending (Imperial) Whiterun are your only options if you want to do the civil war quests. You shouldn't worry too much about it, though - the impact of these quests is fairly negligible.
Is whiterun imperial or Stormcloak?
Whiterun leans heavily towards the empire though shown by the fact that, on the jarls map he marks Whiterun as imperial, that in the bannered mare the bard sings about driving out the Stormcloaks, and that in the civil war questline Whiterun chooses to be Imperial.
