YASUNAGA KOJIMA'S grocery shop, near Tokyo's Tsukiji fish market, has been in business since his grandfather started it almost 100 years ago. He lives above it with his wife. Outside he sells ¥99 ($1.20) bunches of bananas and other fruit, undercutting even the discount convenience store across the street, which sells everything at ¥105.

His customers, many of them pensioners, cherish such bargains. They come in, on average, twice every three days, and buy just enough to put together a few meals. Some economists consider such stores an anachronism, and blame small retailers for the meagre productivity of Japan's service sector. But Mr Kojima's store is no culprit. It is part of a 1,800-strong community of local co-operative stores harnessing the latest technology to win a retail war against the supermarkets.

The stores are part of a voluntary grocery club called Zen Nippon Shokuhin, which since 1962 has acted as a wholesaler to its “mom-and-pop” members. Zen Nippon does not simply buy and distribute goods. It also collects consumer data from its members, which it analyses to guide them as to what their customers prefer.

One of its models is Tesco, Britain's biggest supermarket chain—which, ironically, is often accused of fatally undercutting independent local shops on its home turf. In 2009 Zen Nippon's president, Mitsuhiro Saito, sent six employees to Oxford to learn about Tesco's loyalty-card scheme. They were interested in how the firm uses data derived from the cards to understand not only what people are buying, but also how changes in lifestyle can affect shopping habits.

Peter Wray, a British retail consultant who advised Zen Nippon on Tesco's loyalty system, says its approach sets it apart from the co-op industry internationally, which tends to analyse only what it sells wholesale. Since September Zen Nippon has used technology from an Israeli firm, Retalix, to introduce loyalty cards for shoppers that offer them electronic discounts on their most-purchased items. The information derived from this scheme enables Zen Nippon to bargain with brands for better deals. The programme started with 100 shops and will be rolled out to 1,000 by 2012. The Tsukiji store hopes to take part. Mr Kojima says that, with food prices rising, he wants to give his customers even more personal treatment.

In one sense, this is all a bit circular. As Mr Wray puts it, Tesco mines its loyalty data to help it deliver to shoppers the personal attention they used to expect from a local store. In Zen Nippon's case, the local store will use data to make itself even friendlier.

But in Japan it is a pioneering effort. In contrast to the high-tech nature of much of the rest of the economy, Japan's supermarkets are technophobic and expect little change in shopping habits. This is myopic, Mr Saito believes, adding that one of the biggest supermarkets recently approached him for advice.

Thanks to the new approach, Mr Saito says sales were ¥100 billion last year, a 20% rise from the doldrums six years ago that forced him to rethink his business. That performance is particularly impressive in a deflationary economy. On January 25th the Japan Chain Stores Association said that supermarket sales in 2010 fell for the 14th year in a row.

For all the sophisticated number-crunching that his firm undertakes, Mr Saito still shares the “us-against-them” mentality of small grocers everywhere. He chuckles: “If there are any small stores left in Britain, we'd be happy to help them.”