It's an unfortunate fact that every day around the world, supermarkets throw out tons of food that has spoiled before it could be purchased. While it would be best if that spoilage could be avoided in the first place, British grocery chain Sainsbury's is taking what might be the next-best approach – it's about to start using that unsellable food to power one of its stores.

Here's how the system should work ...

First of all, produce that's a little past-its-prime but still edible is donated to charities, while food that's a little older is given to zoos or used in the production of animal feed.

The stuff that's truly rotten, though, is picked up from Sainsbury's stores across the UK by the same trucks that deliver the fresh food every day – so the trucks aren't making special trips just to pick up the waste. They return with it to the central Sainsbury's depot, where it's subsequently picked up by trucks from the Biffa waste management company.

These trucks deliver it to a Biffa-operated plant in the town of Cannock, where it's fed into an anaerobic digester. Within the zero-oxygen environment inside that digester, bacteria break down the waste to produce bio-methane gas. That gas is then used to produce electricity at the plant.

From there, the electricity is fed to Sainsbury's Cannock store via a 1.5 km (0.9 mile)-long cable. That electricity should meet all of the store's day-to-day needs, allowing the building to operate independent of the national electrical grid. Any extra electricity that's not needed by the store, however, will be fed into that grid.

One byproduct of the anaerobic digestion process is a substance known as digestate, at least some of which can be used as a fertilizer by local farmers.

According to Sainsbury's, it's already the UK’s largest retail user of anaerobic digestion, and has been diverting all of its stores' food waste from landfills since last June.

There's currently no word on when the Cannock program will begin.