LONDON (MarketWatch) — In retrospect, it wasn’t hard to see that the markets were becoming dangerously unstable. Germany had just adopted a new monetary system, and Europe was being flooded with cheap German money. Greece had signed up to a monetary union with Italy and France but was struggling to hold it together.

Financial markets had been deregulated. New technologies were transforming production and communications, allowing money to move across borders at lightening speed.

And a massive new industrial power was flooding the world with cheap manufactured goods, blowing apart old industries.

When it all fell apart in an almighty crash, it was only to be expected.

A prophesy for London, New York or Berlin in 2012? Not exactly. It is a description of Vienna in 1873. In that year, in one of the great crashes of all time, the Austrian markets triggered collapses across Europe, swiftly followed by an equally spectacular collapse in New York. It was the start of what economic historians call the Long Depression, a prolonged period of volatility, unemployment and slumps that lasted an epic 23 years, only coming to an end in 1896.

Is Europe infecting the globe?

I have been researching that episode for my new e-book ”The Long Depression: The Slump of 2008 to 2031.” The parallels with our own time are fascinating. German unification, and the adoption of the gold standard, had led to a boom in that country, and cheap German money had flooded Europe. Greece had just joined the Latin Currency Union, an ill-fated attempt to merge currencies across Europe. Banking had been deregulated, which was partly why so much German money was invested on the Vienna bourse. The telegraph created instant communications, allowing the European crash to spread to New York. The U.S. was industrializing, transforming the global economy as much as China has transformed the present era’s economy in the past decade.

All those factors came together to create an almighty bubble, followed by an even worse crash. The slump that followed — although it is hard to measure these things precisely — lasted more than two decades. If the slump following the crash of 2008 is anything like that one, then this one is going to last until 2031.

The Long Depression: The Slump of 2008-2031 by Matthew Lynn.

True, historical parallels are never precise. We won’t replay the Long Depression of 1873 to 1896 exactly, nor will this slump necessarily last as long. It is, however, a far more instructive episode than the Great Depression of the 1930s. And there are five key lessons we should learn from it.

First, depressions can last a very long time, and when their origins are in a debt bubble they should be measured in decades not years. For a century or more, depressions have been relatively short, sharp episodes. They are like having a tooth pulled, rather than a chronic sickness — painful, but over quite quickly. But it doesn’t have to be that way. In the U.K., for example, this is already the longest recession since records began — in the sense that output is still below its 2008 peak. It is more enduring than the depression of the 1930s. That is true of many other countries, as well. If, as seems likely, Europe, and perhaps the U.S., slips back into recession in 2012, it will be clear to everyone we are witnessing something far longer than the conventional economic textbooks allow for.

Second, this depression is structural. The Long Depression of the 19th century had its roots in financial speculation, technological change, and the arrival of a massive new player in the global economy. Our current depression likewise has its roots in three huge crises coming together at the same time. We have a debt bubble that had been building up over three decade and which burst spectacularly in 2008. The dollar is in long-term decline as a reserve currency, and as the anchor for the global monetary system, but there is still not much sign of what will replace it. And in the euro, the biggest single economic bloc has created the most dysfunctional monetary system in human history, threatening financial collapses on an unprecedented scale. Think of it as the world economy’s suffering a heart attack, then a stroke, then getting picked up by an ambulance that crashes on the way to the hospital — it is hardly surprising the patient isn’t in good shape.

Three, it’s uneven. The Long Depression of the 19th century was a sustained period of lower growth compared with what came before and what came afterward. Germany, for example, grew 4.3% annually between 1850 and 1873 and then at 4.1% between 1896 and 1913. But in the Long Depression years, it only managed a growth rate of just over 2% a year. It was similar in other countries. The markets remained volatile, with repeated booms and busts, regularly collapsing back into recession. They did grow occasionally, just as Japan has sometimes grown in what is now its second decade of slump. But the growth is never sustained.

Four, good things are still happening. It isn’t all doom and gloom. In the Long Depression, some countries were largely unscathed. New technologies and industries were being created. The telephone was invented, and the foundations of new industries based on the petrol engine and electricity were put into place. The people who got it right still made huge fortunes, and the workers in the right industries prospered. Overall, however, times were hard. And you had to position yourself carefully.

Five, it won’t be fixed easily. The parallel with the 1930s is dangerous, because it has convinced bankers and policy makers that if you can just pump up demand, everything will be OK. It won’t.

Sure, demand is important — there is no point in letting it collapse. But this won’t be over until all three structural problems get fixed. Debt needs to be paid down to manageable levels, a new reserve currency needs to be created, and the euro needs to be put out of its misery. None of these are simple tasks, and none will be done quickly.

The global economy will eventually get back to normal growth. But the truth is, it is going to be a long, hard haul — and a lot of work needs to be done it get back on track.