Cannons are the basic defensive buildings. It is generally used as an outerlying defense as its effects are very basic but on Warriors, Archers, Thieves and Demolitionists (generally small troops with low hp). This being effective because it's generally one or two shots singular units.
Cannon is a basic single target defence which is effective against smaller troops generally Tier 1 troops and the Demolitionist. The placement of these Cannons is reasonably important in stopping the enrmy forces from getting to your stronger defenses and your resources. The Cannons if placed correctly should be able to cover the whole perimeter of the base as they are your frontline defenses used to stop enemies from breaching your Walls.