Dave & Les Jacobs/Spaces Images/Corbis

Is there any big city on the planet whose reputation for decadence exceeds Moscow’s? Down through the centuries, Moscow has been known for its “thieving, murdering, fornication” (a traveler in the seventeenth century) and as the “seat of sloth” (Catherine the Great in the eighteenth). In 1881, Tolstoy described Moscow thus in a diary entry: “Stench, stones, luxury, poverty. Dissipation. A collection of robbers who have plundered the people and conscripted soldiers and judges to guard their orgies while they feast.” And when the Soviet Union collapsed in 1991, Moscow achieved global notoriety for its unbridled, nouveau riche party culture. Numerous articles were written about a nightclub near the Kremlin, the Hungry Duck, at which drunken young women, admitted without charge, would dance naked on the bar and offer free sex on the premises to male patrons.

And yet “Moscow Babylon,” as a local newspaper once described the metropolis, hasn’t suffered the fate of its namesake. The word “decadence,” which suggests a long, irreversible decline, is at odds with the city’s remarkable resilience. Moscow drove out Napoleon, endured Stalin, and is the most dynamic, wealthy, and culturally and politically alive place in the former Soviet Union. At least 12 million people live there; the streets are clogged with traffic from the rising number of drivers; and the subway system is jammed with up to 9 million riders a day, partly because migrants from Armenia to Uzbekistan are moving to Moscow in pursuit of a better life. While high oil prices have helped pump up the economy (see “Moscow: Oil Town,” Autumn 2007), Moscow’s diverse business sector also includes finance, fashion, media, advertising, marketing, and tourism. And though the city has legions of conspicuous consumers, tens of thousands of Muscovites, many of them middle-class young people in their twenties and thirties, have braved freezing cold to participate in street protests against the autocratic regime of Vladimir Putin.

So Moscow begs a solution to a riddle: How can a place justly renowned for its wickedness and inequities manage not only to survive but to thrive?

The search for an answer invites a meditation on the role that contrast plays in the formation of urban character. Moscow has never been purely a city of decadence. Rather, it has been for centuries a city of flamboyant, jarring disharmonies. “A city so irregular, so uncommon, so extraordinary and so contrasted, never before claimed my attention,” reported an English clergyman visiting Moscow in the 1770s.

The contrasts go back to Moscow’s medieval roots and can be glimpsed, first of all, in the juxtaposition between the sacred and the profane. Religious enthusiasm was pervasive in the city-state of Muscovy, of which the core was Moscow—at first, no more than a minor trading post on a branch of a branch of the Volga at the eastern fringe of Slavic civilization. There was a revivalist atmosphere in which pioneering monks, hacking monasteries out of the forest, emerged as fierce defenders of a nascent Russian Orthodox culture and infused peasants and princes alike with a sense of holy mission. Moscow’s nobility led the successful charge in the late fourteenth century against the Mongol invaders of Russia. A century later, Moscow laid waste to Novgorod—a rival city-state to the north with much better links to Europe, a more modern municipal government, and a higher rate of literacy. The more cosmopolitan city lost out to the more provincial—but crucially, the more zealous—one.

Moscow’s religious fervor inspired the construction of churches, from modest wooden structures to grand cathedrals, throughout the city. Monasteries and convents also proliferated. Churchgoing was not for the sedate. Typically, there were no pews. On stone floors, for hours on end, congregants stood close to one another in rooms perfumed by incense and the smell of unwashed flesh. If liberating of spirit, worship was also punishing of body.

It could be that intense pursuit of high passions drove an equally energetic quest for lower ones—or maybe it was the other way around. But Muscovites certainly paid heed to both ends of the moral spectrum. Disgusted, Catherine the Great, who was born and raised in Germany, found Moscow not only indolent but also “full of symbols of fanaticism, churches, miraculous icons, priests, and convents, side by side with thieves and brigands.”

Helping propel Moscow into this dichotomous terrain was vodka, which had been developed in western Europe for medicinal purposes but found its way into Russia and into the insatiable throats of the dwellers of its greatest city. Alcoholic spirits previously had been consumed in milder forms, such as mead, made of fermented honey and water. Vodka was different—not just because it was stronger but because it exerted a cultlike hold on imbibers of “all classes, both secular and ecclesiastical, high and low, men and women, young and old,” as a horrified German visitor in the seventeenth century noted. The visitor attributed Muscovites’ tendency to act like “unbridled animals” to alcoholism. Yet vodka also fulfilled what a Russian writer called “an age-old requirement for the miraculous and extraordinary.” Vodka was a means “to transport the soul beyond earth’s gravity.”

Vodka, then, showed how the sacred and the profane could commingle and even be mistaken for each other. What seems distinctive about Moscow was that it was not divided, as some cities are, between saints and sinners, between the upright (at least in public) and the fallen. Instead, a Muscovite could be in good stand- ing even while embracing dissolute habits. Indeed, such conduct was typical.

Rectitude and laxity combined, for example, in the typical Moscow merchant, a prosperous species that defined the city’s mores as Moscow expanded as a commercial center in the nineteenth century. Though one segment of the merchant class adopted a variant of the Puritan work ethic, more commonly the spirit of capitalism took liquid form. Alcoholic excess was not limited to weekends or even to evenings. At the end of the nineteenth century, “the highly respected mayor of Moscow, himself a merchant, would sometimes turn up at a restaurant with a group of his merchant friends for lunch, place his high top hat on the table and order champagne,” a chronicler noted. “When the hat was full of corks, they would get up, pay and return to their offices.” Twelve-course repasts to accompany the drinking were the norm.

This picture may seem exaggerated, but Moscow, like a Dostoyevsky novel, abounded in hyperbole. Muscovites, it seemed, were natural multitaskers, with visitors from Europe struck by their ability to combine work and play. The city’s merchants had a “lust of gain” but also “a cheerfulness of temperament wholly wanting to the German and English merchant,” noted a nineteenth-century German visitor to Moscow’s Ryadi market. “The Russians carry on their business in the midst of praying, tea-drinking, . . . playing, laughing and gossiping.”

Moscow’s moral disharmony is mirrored in its appearance. No grand architectural vision is responsible for Moscow; rather, a tiny village became, over centuries, a vast, overgrown city. It grew messily, in splotches radiating out from the Kremlin, and pity the reformer, the earnest planner, who tried to bring it to heel.

There was Peter the Great, for one. Peter couldn’t abide the squalid marketplace on the plaza that lay outside his Kremlin and extended down to the river. This plaza—first known as Trinity Square and then as Red Square, a name that has nothing to do with Communism—had a noxious “mephitic air,” in the words of one French aristocrat; it reeked of sour beer, grease, and undrained cesspools and offered natural cover for criminals. But while Peter pulled down the bazaar, he couldn’t realize his larger ambition to remake Moscow. Instead, starting in 1703, he constructed an anti-Moscow on barren ground 400 miles to the north, making his new Petersburg an obsession of top-down, Euro-imitative planning, from the Venetian canals bordered by Italianate palaces to the French-style gardens. Petersburg achieved coherence and a certain grandeur but at the price of authenticity.

For all of Moscow’s unseemliness, it had considerable beauty to entice the senses, even in Peter’s time. Throughout the worshipful city could be heard the song of the “silver-tongued bells,” the “language of heaven floating through the skies,” as the historian Kazimierz Waliszewski wrote. There was an austere beauty, too, in the chants that dominated Orthodox ritual in the churches. Near the Kremlin was a magnificent flower, plant, and shrubbery market, with merchants selling violets, roses, and cherry trees out of huts painted to look like gardens of buttercups.

Moscow’s alchemy proved irresistible even when tidier Petersburg was the political capital of Russia, from the early eighteenth century until the Bolshevik Revolution in 1917. Late czarist-era Moscow had more wealthy people and more bookstores than Petersburg, and it remained the nation’s spiritual capital, unequaled as a shrine for romantic yearning. “To Moscow, to Moscow,” Chekhov’s characters chant in his play Three Sisters, first performed in 1901 at the Moscow Art Theater. “There’s nothing on earth better than Moscow.” Earlier, in War and Peace, Tolstoy had written that “every Russian looking at Moscow feels her to be a mother.”

There is no greater testament to the hardiness of this city of disjointed parts than its survival under the rule of Soviet masters who seemed to believe that anything crooked could be made straight. Rote destruction was their method, and religious Moscow suffered most. Magnificent bells were ripped out of church belfries, and numerous cathedrals, churches, monasteries, and convents were demolished. All of Moscow, aglow with electric lights that transfixed visitors from the provinces, was meant to adhere to a triumphant, futuristic aesthetic, an architectural expression of a radical new phase of human existence. Though any clear-eyed understanding of Moscow would have suggested that its possibilities as a utopia were severely limited, some credulous Western modernists subscribed to the plan. The mammoth Cathedral of Christ the Savior, built in the nineteenth century to honor the expulsion of Napoleon from Russia, was blown up in 1931 to make way for a planned “Palace of Soviets,” and both Le Corbusier and Walter Gropius submitted designs. The winning entry, by the Soviet architect Boris Iofan, called for a massive structure, taller than the Empire State Building, topped by a giant statue of Lenin with his right arm raised in welcome.

The Palace of Soviets was never completed—in 1960, a heated swimming pool was instead put on the site—but Stalin nevertheless reshaped the city with assorted modernist concoctions, such as the seven “wedding cake” skyscrapers, whose ornate, terracelike exteriors harked back to Gothic cathedrals. Still, like Peter before him, Stalin couldn’t forge Moscow into a uniform type. “I still confront its heaped-up beauty and tawdriness with a sense of fresh surprise,” wrote Eugene Lyons, an American journalist who visited Moscow in the mid-1930s, as the Stalinist architectural wave was gaining ascendancy. “The 15th century and the 20th are inextricably mixed.” On an earlier trip to Soviet Moscow, the German-Jewish-Marxist writer Walter Benjamin found that “in contrast to the Prussian cleanliness and the order of Berlin,” whose streets he likened to “a freshly swept, empty racecourse,” Moscow “nearly overwhelms. . . . with an aesthetic surfeit of colors, disorganization, and teeming humanity.” He found himself transfixed by the “wild variety” of the (mostly illegal) street trade. “Shoe polish and writing materials, handkerchiefs, dolls’ sleighs, swings for children, ladies’ underwear, stuffed birds, clothes hangers—all this sprawls on the open street.” Icons, too. And “off the broad avenues, peasant huts alternate with Art Nouveau villas.” Not even a social, political, and economic revolution could transform the soul of Moscow.

Today, with Moscow’s refurbished international airports connecting the city to the currents of global capitalism and with certain styles of “Old Russia” back in nostalgic fashion, Moscow has attained a discordant peak. Never has the city displayed a more dizzying mélange of aesthetic and historical specimens, and the age-old moral dichotomies remain in place. The area around Pushkin Square, up Tverskaya Boulevard from the Kremlin, includes a Tiffany’s, a McDonald’s, a fancy Russian restaurant meticulously done up as a czarist-era Petersburg palace, a Swedish-owned “nightclub” at which voluptuous prostitutes solicit a largely foreign clientele, and a Chicago-style steakhouse flanked by a pair of striptease parlors. By the riverbank, Christ the Savior stands rebuilt; it is a 15-minute walk from Lenin’s Tomb on Red Square, where the embalmed corpse of the Father of the Revolution remains open for public viewing. Up the street from the massive Lubyanka—the headquarters of the Soviet security services, in the basement of which prisoners were tortured and executed—is the Sretensky monastery, founded in 1397, appropriated by Bolshevik hoodlums for their shooting parties, and now the restored home of several dozen monks.

The ultimate expression of Moscow’s helter-skelter personality is its Stalin-era subway system, some of whose stations were built with marble from the destroyed Christ the Savior. The travel writer Martha Gellhorn, fresh from a visit to Moscow in 1972, said that the stations resembled “vast subterranean Turkish baths, with a touch of old-time Roxy movie palaces.” But even that description makes the Metro sound more uniform than it actually is, for there is no effort to reconcile clashing styles and sensibilities that evoke wildly varying emotions. The elegant stained-glass panels of the Novoslobodskaya station soothe as in a chapel. The procession of “bronze men” in the Revolutionary Square station, originally meant to convey the heroic narrative of the Bolshevik workers’ conquest of Russia, now comes across as kitsch. The most popular figure in that station is a border guard on his knee, one hand clasping a rifle, the other caressing his faithful sentry dog. The dog’s nose is polished by Metro riders possessed of the belief that a rub can bring good luck.

But the stations can also unsettle. On my most recent visit to Moscow, last year, I paid a visit to a new station beneath the street of Dostoyevsky’s childhood home. Dostoyevsky’s classically Orthodox idea that “suffering is the sole origin of consciousness,” as he put it in Notes from the Underground, is brought to haunting life with panels illustrating scenes from his novels. In one, from Crime and Punishment, we see Raskolnikov, soon to be a guilt-ridden sufferer, splitting open the heads of an elderly pawnbroker and her sister with an ax. Protests that the murals would encourage depressed commuters to commit suicide failed to doom the project. Score another one for Moscow’s insistence on a sensibility that traverses the philosophical gamut.

The one part of contemporary Moscow that might be considered uniform is its civic and political character. The Kremlin is an omnipresent force and doesn’t hesitate to throw its weight around, especially in the era of Putin, a former KGB colonel with an admitted nostalgia for Soviet times. By federal law, the mayor of Moscow is not a popularly elected official but a Kremlin appointee, subject only to the rubber-stamp approval of the city council. Currently occupying that office is a professional bureaucrat, Sergey Sobyanin, formerly Putin’s chief of staff. Sobyanin moved into the mayor’s seat in 2010 after the Kremlin sacked his predecessor, Yury Luzhkov, for not toeing its line.

It thus seems that Moscow has been incorporated into what the Russians call the vertical vlast—the nation’s hierarchy of power, with the Kremlin at the pinnacle. But appearances are deceiving, for there is a growing civic pushback—a kind of countervailing force, at the base of this pyramid, to the “do this, take that” attitude held at the top. Here, too, the principle of contrast is at work. Moscow is subject to more Kremlin control than any other place in Russia; yet the grassroots resistance to the controllers is greater in Moscow than in any other city. Moscow is the cradle of the country’s street protests, now about a year old, in which Putin is depicted as a crook, a thief, and an object of satiric derision. Political theater has at times approached an art form—as at an event dubbed the Big White Circle, when thousands of protesters, wearing white ribbons, formed a ten-mile-long human chain encircling one of the city’s most prominent boulevards, as merchants doled out free chai and blini and falling snow enveloped the assemblage. In a recent exploit at Christ the Savior, members of the female punk band Pussy Riot took to the altar and chanted a novel prayer: “Our Lady, chase Putin out!” For this stunt, three members of the band were arrested and put on trial on charges of antireligious hooliganism, and two are serving prison sentences.

Beyond the immediate objections to Putin is a determined bid by Muscovites for a greater say in everyday matters that affect their neighborhoods, such as urban-development projects. A new generation of political figures includes such figures as Maxim Katz, aged 27, elected last year to a local district council on the platform of humane, small-scale development. Katz fails to conform to any standard Russian political mold: he is Jewish; he has long, flowing hair; he is loosely aligned with the opposition to Putin but is not of any established party or movement. A former national poker champion and of independent means, he is an eccentric—but then again, the eccentric is itself an established type in Moscow. For this type to find expression in civic and political life as a counterpoint to the anodyne Putin model is unsurprising. There is a recurrent pattern to political thunderclaps like the one now reverberating in Moscow: in the late 1980s, after all, the city was ground zero for the rebellion that culminated in the dissolution of the USSR.

If Moscow has lessons to teach other cities, one is that contrast can be good for its own sake. It can, for example, heighten the charm of a district. I’m thinking of the bucolic area of tree-lined footpaths and benches around Patriarch’s Ponds, known for its association with the novelist Mikhail Bulgakov, who lived nearby. The multilane Garden Ring highway, a pedestrian’s nightmare, is a short distance away, making this quiet neighborhood all the more sweet a respite.

Heterogeneity is also arguably essential for the creation of great culture. By giving grist to the likes of Pushkin, Tolstoy, Chekhov, Pasternak, Prokofiev, and Shostakovich—and by providing a home for the Bolshoi Theater and the Moscow Art Theater (cofounded by Stanislavski)—Moscow attests to the value of ferment as a distiller of world-class art. The happy prognosis, with post-Soviet Moscow at least as agitated a cocktail as earlier versions, is for more great art. But the price for this striving toward the spectacular is the dreck: Moscow is also an advertisement for abysmal taste. A prime example is the supersize Peter the Great monument in the Moscow River, a work by the artist Zurab Tsereteli that was erected in the 1990s and strikes nearly everyone, professional critic and layman alike, as an offense to the eye. Intended to commemorate Peter’s beloved Russian navy, the 315-foot-high monument displays a towering Peter astride what looks like a toy boat, the vessel perched precariously atop a column of what are supposed to be waves. In 2008, the website VirtualTourist voted it tenth on a list of the world’s “Top Ten Ugliest Buildings and Monuments.” Yet Muscovites, while not protesting this insult or even disagreeing with it, have so far stuck with their Peter.

Moscow also shows that a city can benefit from a mix of uses. It is not only a political, religious, commercial, and cultural capital but also a home for manual laborers. Smelly, dirty factories, making textiles, chocolates, machine tools, tires, automobiles, military goods, vodka, and much else, have long had a place in Moscow and contributed to its grit. That era, though, may be drawing to a close.

There’s a lesson, too, about the blessing that a churning population bestows on a city. To be sure, it is a mixed blessing. Today’s Muscovites worry that a seemingly uninterrupted flow of migrants from peripheral regions like the Caucasus and Central Asia threatens to overwhelm the city’s capacity to absorb them. (Moscow’s true population, once you include immigrants not recorded in the official census, may be 17 million, some 5 million more than the official count.) In 2011, the police discovered an “underground town” in western Moscow, where more than 100 undocumented immigrants from Central Asia lived in a Soviet-built bomb shelter outfitted with makeshift “bathrooms, bedrooms and even prayer rooms,” according to the government. The residents were apparently workers at a factory producing parts for sewing machines.

Still, Moscow has long been a mecca for transient, uneducated people in search of paying work, often of a seasonal type—as in the second half of the nineteenth century, when rustics from the Russian countryside poured into the city and lived in workers’ slums. Upward mobility was possible in the Moscow of that industrializing era, when “the majority of the most prominent entrepreneurial families claimed peasant ancestors,” a historian noted. So it may be for today’s “peasants.” Some are making it—and their earnest strivings are one more thing that keeps Moscow from lapsing into a complacent torpor. The immigrants are Muscovites in the making, unlikely to prove resistant to the city’s assimilationist undertow. The broader point is that cities that close their doors to needy newcomers are apt to have a harder time maintaining their economic and cultural dynamism.

Surely the most cheerful lesson that Moscow teaches us is the near-indestructibility of the city as an organic life-form. If today’s Moscow were razed (as early Moscow was by fire, on several occasions), it would likely come back along similar lines, so resilient is its urban DNA. The corollary is that urban planners there can proceed with bold experiments knowing that a botched job is unlikely to wreak permanent ruin—but knowing, too, that no matter how ambitious their project, they are unlikely to alter the city’s character dramatically.

None of this is an argument for squalor or bad taste or a plea for wickedness and inequity. Rather, it is a recognition that the disparate parts of a great city don’t have to match; sometimes, they merely have to chafe against one another. Never was Moscow better appreciated in this regard than by the poet Konstantin Batyushkov, who wrote in 1812, in his essay “Walk Around Moscow”: “Here are luxury and penury, abundance and the most extreme deprivation, piety and atheism, . . . and an unbelievable frivolity—warring elements which, out of their constant conflicts, create this marvelous, outrageous, gigantic whole which we know by its collective name: Moscow.”