Merpeople, along with other similar underwater humanoids, are often depicted as living in great cities beneath the waves. These cities have many positive things going for them: plenty of real-estate, easy to build upwards, fairly consistent weather, and lots of access to water. While these cities are often depicted as being laid out in a similar way as surface cities, this seems like a poor choice for defense. Walls and gates are trivial to swim over, and bombardment from above is a constant threat. Furthermore, traditional means of both ranged defense and attack may be useless underwater, given that projectiles can't be fired as effectively through water.
My merpeople are unsatisfied with this arrangement, and have commissioned their finest mer-architects to build them a more defensible mer-city. Their mer-king has approved the plans and the mer-chants have accumulated the money to build. What kind of threats do the architects need to keep in mind, and what sort of fortifications and defenses should they build to keep the city safe?
The merpeople in this world have fish-like lower bodies and humanoid upper bodies. they've got primitive lungs that allow for limited activity outside of the water but breathe primarily using gills. Technologically, they aren't terribly advanced, perhaps at the same tech level as the late Roman empire. They've got some metalcraft, using undersea volcanoes for forges. They don't have much in terms of explosives or gunpowder, though the mer-king is willing to invest in researching such things if they're the best bet for defenses. They have had significant success domesticating other undersea creatures, so sharks and whales are available as resources.
The king is primarily worried about attack from other merpeople, as well as some other unsavory underwater humanoids. He's got trade and contact with the surface folk, who are about at the same tech level as his kingdom. They fight, occasionally, but the combat is mostly restricted to the surface of the ocean, leaving the underwater cities untouched.