Constantinople was blessed geographically.
The city is strategically placed on a narrow peninsula touching 3 sides by water — Sea of Marmara to the South, Golden Horn to the north, and Bosphorus Strait to its North East. Enemies would need to cross either one of these 3 waters to get to Constantinople.
This means that its land army can be focused on defending one exposed flank at the West, and have strong naval army monitoring the harbours.
Sea defense
Both the Goldern Horn and Bosphorus Straits are narrow — at their narrowest point, only 1 mile and 1.5 miles wide respectively. By building chains and forts on these narrow straits, the Byzantines were able to defend their harbours.
The Bosphorus straits was only 40 feet deep at its deepest point. This shallow waters makes it difficult for enemy ships to navigate through the strait in large numbers needed for an invasion.
Furthermore, during the time taken for enemy ships to travel down that narrow strait, they would have been surrounded by Constantinople army (‘Choke point’).
Land defense
In terms of land defense, Constantinople was also one of the most fortified cities in the Middle Ages. The city was surrounded by massive, double set of walls made of stones and bricks, strengthened by towers and gates.
The outer wall was 14km long, and 5m high. The inner wall was about 5km long, and 10m high. The walls of Constantinople were considered to be one of the most impregnable fortifications in the world.
The combination of natural harbours surrounding the peninsula, coupled by its impressive fortress had protected Constantinople for approximately 1,123 years despite constant foreign attacks.
Nonetheless, the Ottoman Turks, with its larger army brandishing cannons led by Sultan Mehmed II, eventually took the city down in 1453 C.E.
The fall of Constantinople was the turning point in history that marked the end of the Roman Empire.
Note: a peninsula is defined as a piece of land that is surrounded by water on 3 sides and is connected to a larger landmass on the last side.