As your base expands, use layers in your building methods to fortify it as much as possible. Other buildings besides your Town Hall, though not ideal, can serve as a makeshift wall in a crisis. Don't be afraid to use them around your base. Ideally, place a wall, then a few buildings and then another wall, with other defensive structures interspersed throughout the layers.