THE West has rightly marvelled at China's economic miracle. Less noticed is a minor miracle in its own midst. It is time to pay attention to Germany's new Wirtschaftswunder.

Germany had a savage recession as manufacturing orders dried up, but its economy has since bounced back strongly, expanding by 3.6% last year, far faster than most other rich economies. For sure, this was partly a “bungee effect” after a particularly deep downturn, but it is no one-year wonder. By several measures, including keeping unemployment down (it is at its lowest since 1992) and the prosperity reflected in the growth of GDP per head, Germany was the star performer among the rich G7 countries over the past ten years (see article). Germans entered 2011 in their most optimistic mood since 2000, according to Allensbach's polls. Business confidence is at its highest since the Ifo institute began tracking it 20 years ago.

What's Germany's secret? It helps that the country did not experience a property or credit bubble, and that it has kept its public finances admirably under control. But above all Germany's success has been export-driven: unlike most other big rich economies it has maintained its share of world exports over the past decade, even as China has risen.

This is not—advocates of an active industrial policy please note—thanks to a special genius among German policymakers for picking winners, though businesses have benefited from strong state-supported research institutions. Luck has played a part. Germany has a cheaper-labour hinterland right on its doorstep in central Europe that has helped companies raise efficiency and hold down pay. Meanwhile, German firms happen to produce exactly the things that a booming China wants, from luxury cars to the machinery that enables Chinese factories to be the workshops of the world. So Germany has been a big winner on both the supply side and the demand side of globalisation. The euro also provided a bonanza, thanks to (unsustainable) demand in places like Spain and Greece.

But there has been plenty of skill, too, as our briefing on German business explains (see article). German companies have excelled at seeking out unglamorous but profitable niches, and then focusing relentlessly on being the best. This is particularly true of the Mittelstand, the small and not-so-small companies that are the backbone of the German economy. The likes of Koenig & Bauer (which makes printing presses), Leitz (wood-processing machines) and RUD (industrial chains) may not be household names, but they are world-beaters.

Such traditional German virtue is now all the more effective thanks to liberalising reforms of recent years. Under Gerhard Schröder, a Social Democrat who was Angela Merkel's predecessor as chancellor, the so-called Hartz reforms made labour markets more flexible and made work a bit more attractive compared with living on unemployment benefits. And with the loosening of banks' cross-shareholdings, German business is a less cosy and cosseted affair; bosses are freer to cull underperforming operations and to focus on growth.

German businesses also took a gamble during the downturn. With the help of government subsidies they held on to their workers, betting that order books would quickly fill up again. They did, so German companies retained the skills and the manpower to respond quickly to the upturn.

As in Beijing, so in Berlin

All this explains why German leaders can sound a little smug these days. In Davos last week Mrs Merkel invited fellow Europeans to learn from Germany's experience. Follow the German model, the message seems to be, and all will be well.

Others might well usefully emulate German firms' discipline, focus and nurturing of talent, as well as Germany's labour-market reforms and its sound finances. Yet the German model remains flawed in two important ways. First, it is too dependent on foreign demand, reflected in an excessive current-account surplus of 5% of GDP last year, while consumer spending is feeble (one reason why enthusiasm for the government is low too, see article). If every European country followed that example it would be a recipe for a slump. Instead, like China, Germany needs to rebalance its growth, with greater efforts to boost demand at home. More spending in Germany would also help struggling economies elsewhere in Europe. The second blot on Germany's copybook is its poor record in improving productivity. In contrast to Germany's industrial prowess, its bigger services sector remains overprotected and inefficient. More competition and less red tape would help.

Without a rise in domestic spending and progress in productivity, Germany's success will falter. It is encouraging that consumer spending has started to play a bigger role of late. Productivity-enhancing reforms of services should be next. Half a German miracle is not enough.