When planning and building your village, you have to make sure that your main building, storage, and production buildings are well protected. Nothing is worse than losing all your food or ammo storage at night. This usually leads to a quick death within the next few nights.
Surround your village with fences and make sure that all sides are covered by towers and other buildings your survivors can occupy. Towers are great for snipers and they can pick off enemies before they get too close.
You also need to take the line of sights of your buildings into account. Shacks have a very limited line of sight while towers provide 360 views.
Be careful when planning your defenses. If zombies can't find a quick way to get around a fence, they will attack and destroy it which can leave you wide open for all the other zombies coming from that direction.
It is better to give them a controlled opening which is spiked with traps and other defenses. Upgrading fences makes zombies "think" twice whether they want to try to destroy it. The stronger the fence or wall, the more likely it is that zombies will try to find a way around it.
If they do make it through your defenses, try to keep zombies away from your vulnerable buildings by placing scarecrows strategically. They will draw the zombies away from your food and ammo sources and you have time to kill them before they can deal too much damage to your village.