Defense
This page contains some examples of defensive structures.
Defenses in Factorio are generally split between three different categories- static defenses which attack, static defenses which stop attackers, and defenses which repel attackers. Additionally, some defenses can be placed by the player, such as landmines. Finally, the player can respond to situations on their own, though this is not recommended due to the speed and size of biter attacks.
Basic
A few Turrets are a good start.
Advanced
Add a reloading system or try some Laser turrets.
Expert
Laser turrets and a thick set of Walls with fast Transport belts for added defense. The second example shows how you can abuse the biters AI into running all the way to the turrets instead of eating through the walls.