San Bernardino, a southern California city of more than 200,000, recently declared bankruptcy. Municipal bankruptcies are rare, but not unprecedented.

Vallejo, Calif., in the San Francisco Bay area, for instance, filed for bankruptcy protection in May 2008. Jefferson County, Ala., sought bankruptcy protection in November 2011. And Stockton, Calif., population 300,000, filed for bankruptcy on June 26, after essentially spending itself out of business. Other cities, including Harrisburg, Pa., also stand at the brink.

But it doesn’t have to be. As the residents of Sandy Springs, Ga., can attest, cities can provide residents with all necessary services at an affordable price: if they break away from the old public employment model.

Stockton’s problem was twofold: the housing bubble burst, significantly reducing property tax revenues, and it bought into the notion that it could spend itself into prosperity by using tax funds to support local “economic development” and “revitalization” projects, such as a hockey arena. Private investors weren’t interested in risking their money, so the city took on the projects.

When private developers won’t go it alone the market is sending a powerful signal about a project’s profit potential. Stockton’s political establishment ignored these signals, acting as speculators with taxpayers’ money—and they lost.

The politicians also had been betting on continuing increases in property tax revenues. In 2008, as the housing market was starting its collapse, the U.S. Census Bureau reported that property taxes accounted for $397 billion, or 72.3 percent, of the $548.8 billion in local tax revenues around the country. In California and other areas with above-average property value increases, local officials counted on these revenues to pay for generous wage hikes and health-care and pension benefits for public employees.

Again, they made a bad bet. The housing bubble burst, many houses went into foreclosures, and revenues plummeted.

Harrisburg, San Bernardino and Stockton aside, some cities are doing just fine.

Consider Sandy Springs, Georgia’s fifth largest city. Incorporated less than 10 years ago, Sandy Springs, with nearly 94,000 residents, has averted the budget pitfalls experienced by other municipalities, in the words of the New York Times, by handing off “to private enterprise just about every service that can be evaluated through metrics and linked into a contract.” In economists’ jargon: by outsourcing and privatizing.

As the Times noted, “hovering around the debate about privatization is a basic question: What is local government for? For years, one answer, at least implicitly, was ‘to provide steady jobs with good wages.’”

Sandy Springs rejected this model. As Oliver Porter, a retired AT&T engineer who served as interim city manager when the former Fulton County community was incorporated at the end of 2005, noted in a first-person article: “Imagine starting a new city of over 90,000 people with only two employees. We did it.”

As Porter explained, the challenge was to create something—a mid-size new city—virtually from scratch. “It was obvious that an alternative model was required.”

A few cities, he noted, use private contractors to provide specific municipal services, such as road maintenance, water works and trash collection, but “no city as large as the future Sandy Springs” had ever contracted for a package of services that included just about everything, except police and fire protection, which the city is required to provide itself under Georgia’s constitution. But Sandy Springs did it; and it works.

As Porter reports, while surrounding “traditional cities” have experienced severe budget problems during the prolonged downturn, Sandy Springs has enjoyed large surpluses, at the same time building up a reserve fund that stood at $21 million at the beginning of 2010.

Indeed, during its first three and a half years in existence, according to Porter, Sandy Springs not only successfully created a police force and fire department—“with all new equipment”—it paved more roads than Fulton County had in the previous 20 years, and opened several new parks. Most city services are provided by outside contractors, which he considers the city’s partners.

Not every American city can be a Sandy Springs, but others should try. Without deep reforms, more bankruptcies are virtually certain.