The city of Dubai in the United Arab Emirates is known for extravagant, newly built landmarks like the Burj Khalifa, the Palm Jumeirah, and the Dubai Mall.

In just over two decades, the city has transformed from a desert backwater port to a thriving metropolis with the third-most skyscrapers in the world.

While the rapid development has produced a futuristic city, it has come at the cost of hundreds of thousands of workers and produced a city that can feel soulless.

Dubai markets itself as a liberal Hong Kong in the Middle East, but it hides the fact that it is still ruled by an autocracy and that legal rights frequently don't hold up for foreigners.

During a visit to Dubai's downtown, I became aware of just how radically the city has developed, as well as the consequences — both positive and negative — of that development.

Three decades ago, Dubai was little more than desert.

The city exploded in prosperity after the United Arab Emirates discovered oil in 1966, leading to a development boom that has resulted in the world's tallest building, the second-biggest mall, one of the most luxurious hotels, and more skyscrapers than any city besides New York and Hong Kong.

From the outside, Dubai looks like an unmitigated success story. Whereas many other Gulf nations — like Qatar, Saudi Arabi, and Bahrain — still rely heavily on oil exports to drive their economy, Dubai is driven by tourism, real estate, tech, shipping, and financial services.

Oil and gas now accounts for less than 1% of Dubai's economy, down from 50% at one point, according to Bloomberg.

The development has been aimed at becoming the Middle East's Hong Kong or Singapore — an easy place to visit, spend money, and do business.

But for those looking at Dubai and wishing their country or city would use it as a model, Dubai may be more of a cautionary tale. The shiny, glass towers hide the trampling of the hundreds of thousands of migrant workers that built them. They hide the often opaque and arbitrary legal system, and the fear over what happens to the economy when the cranes stop building and the flow of foreign investment dries up, as happened in 2009.

I recently spent a day in Dubai's downtown to see the fruits of the city's rapid development.