LOOK out from the cafés of Accra’s financial district and you could be almost anywhere. In the shadow of glassy skyscrapers, American-accented entrepreneurs order lattes and ponder spreadsheets. “You couldn’t have imagined this even five years ago,” Joseph Baffour, a local financier, says of his surroundings. “There’s been an astronomical change.”

On a continent once synonymous with war, famine and poverty, a middle class has started to emerge, propelled by growth and urbanisation. Its rise has much to do with the spread of democracy and greater rule of law—countries with such attributes tend to generate more economic opportunities than those in which a few rulers line their pockets. In turn, the new middle classes have raised their voices in demanding clean and accountable government and public services. A study by Nic Cheeseman of Oxford University, found that in Kenya the richer people were the more likely they were to support democracy (and vote for the opposition).

Yet step beyond the air-conditioned malls that are popping up like meerkats across the continent, and it is clear how thin this emerging middle class is. Just a few miles down the road from Accra’s coffee-connoisseurs are the columns of smoke that billow above Agbogbloshie, a digital dumping ground. Here hundreds of men risk their health burning old electronics for useful parts. Leave the capital altogether and the celebrated middle class grows harder still to spot: high-rises give way to huts, suits to shoelessness.

So too with much of Africa. Good data on the exact size of the middle class are hard to come by, but it remains small across most parts of the continent. The Pew Research Centre, an American outfit, reckons that just 6% of Africans qualify as middle class, which it defines as those earning $10-$20 a day. On this measure the number of middle-income earners in Africa barely changed in the decade to 2011.

More recent data from EIU Canback, a consultancy (and sister-company of The Economist), show some growth (see chart) in the decade to 2014 but it is painfully slow: 90% of Africans still fall below the threshold of $10 a day and the proportion in the $10-$20 middle class (excluding very atypical South Africa), rose from 4.4% to only 6.2% between 2004 and 2014; over the same decade, the proportion defined as “upper middle” ($20-$50 a day) went from another 1.4% to 2.3%. Other surveys are also disappointing. Standard Bank, a South African lender, thinks that though the number has increased, there are still only 15m middle class households in 11 of sub-Saharan Africa’s bigger economies (excluding South Africa and using a range of $15-$115 a day).

The puzzling question posed by these data is why the middle class is so small after a decade in which economic growth has averaged more than 5% a year, about twice as fast as population growth. One reason is that the proceeds of economic growth are shared very unequally. In recent years inequality has increased alongside growth in most parts of Africa. Another reason is that poverty in many parts of Africa is so deep that even though incomes may have doubled for millions of people, they are now merely poor rather than extremely poor. Laurence Chandy at the Brookings Institution, an American think tank, points out that the average person in extreme poverty in Africa lived on just 74 cents a day in 2011, compared with 98 cents in other parts of the developing world. Ethiopia, which is both one of Africa’s most populous nations and best developmental performers, is a good example. Its share of people living on more than $10 a day has increased more than 10 times in the decade to 2014 to 2% of the population: but that still left close to 98% of Ethiopians living below this threshold. A low wage is better than none at all, but those living on $10-$20 a day are hardly sipping sangrias at sunset. For most of them, life is still tough. “I came from the north because I needed a job,” a sweating Awal Ibrahim says as he cuts the copper out of old computer wires in Agbogbloshie. Working relentlessly in the baking heat, he earns about 20 cedis ($5) a day. Does he still feel poor? He glances with commendable humour at the smouldering Sodom surrounding him: “If I could find other work I would.” That is the problem. Unlike Asia, Africa has failed to develop industries that generate lots of employment and pay good wages. Only a few countries manufacture very much, largely because national markets are small and barriers to trading within Africa are huge. Most people who leave the countryside move into labour-intensive but not very productive jobs such as trading in markets. John Page, also of Brookings, reckons that such jobs are on average only about twice as productive as the ones that many left behind.

For investors who piled in on the promise of a new African bourgeoisie, this is a worry. The commodities boom has ended and all but the richest tend to stop spending at the first sign of economic trouble, as they have done in Nigeria and South Africa, the continent’s two largest economies. Having overestimated the number of upwardly mobile people, many big firms are expanding far more slowly than they expected. A few years ago, Shoprite Holdings, South Africa’s largest retailer, envisaged opening 600-800 stores in Nigeria. It currently has 12. Across the continent in Kenya, Cadbury and Coca-Cola have closed factories. “We thought this would be the next Asia”, Nestlé’s chief executive for equatorial Africa said earlier this year. “But we have realised the middle class…is extremely small and it is not really growing.”

Those investors with deep enough pockets can afford to wait. In the meantime, they are expertly targeting poorer shoppers with such things as tiny packets of washing powder and water. In Nigeria UAC Foods sells cheap sausage rolls through bus windows rather than in supermarket aisles.

But those concerned about raising economic growth and the spread of democracy in Africa should be less patient. The middle class that has emerged, small as it may be, is also vulnerable; even mild economic shocks may be enough to push households back below the threshold of poverty. That in turn may slow the impetus for reform, and perhaps even reverse it.