It ain't cannon, but the book Star Fleet Dynamics (Set during ST6) says there are 32 Starbases spaced equally throughout the spherical "Treaty Exploration Zone." They are built on habitable planets if the system is near enough to the arbitrary point where they want the SB. If no such planetary system exists then they build a space station to do the job. The point of the base is to provide a local command center for exploring and patrolling ships and to support said ships with repair and resupply facilities. As they are all essentially ground bases (even the space stations given that they are large enough to support huge populations) personnel assigned there are free to bring along their civilian families. Other civilian activity is encouraged as the Starbases are also available to support civilian traffic and populations. No doubt civilian expansion of these facilities would result in large scale colonies developing over time, but originally, and at it's core, a starbase is a Starfleet owned and operated facility under Starfleet command and jurisdiction. Ship's assigned to certain areas of the Treaty Zone would be assigned to the nearest Starbase. Each one would be assigned one Dreadnaught to handle any big military episodes.
Personally, I like this explanation because My personal vision of Trek tends to be somewhat Franz Josef-centric/FASA-centric and I don't think so much about post-1987 Star Trek. This same take though doesn't really violate TNG+ starbases, if you just assume that more were added as the Feds kept exploring past the Treaty Zone.
In the series format Roddenberry pitched to the NBC Execs, Starbases were the frontier forts in his "wild west of the stars." they would serve the same military (and more importantly, dramatic) value as those palisaded forts we all remember from John Wayne movies.
And BTW, DS9 wasn't ever referred to as starbase. But there were references to other Deep Space Stations. So the question I'd like to ask is what's the difference between a Starbase and a Deep Space Station?
--Alex