SCOTLAND may not have broken off from Britain last year, but at least it got into space. Overshadowed by the ballyhoo over the referendum, the first satellite built in Scotland, UKube-1 (pictured below), was launched. The same dimensions as a boxed bottle of whisky, it was assembled on the banks of the river Clyde in central Glasgow by the country’s first satellite manufacturer, Clyde Space. It is but one example of Scotland’s surprisingly healthy engineering industry.

The clean room where Clyde Space makes its satellites affords an excellent view of Govan, once a centre of world shipbuilding and now a reminder of how quickly huge industries can collapse. Rather than trying to build everything, therefore, as the Clyde shipyards used to, Craig Clark, the founder of Clyde Space, is trying to master one small, but growing, niche of his industry. He builds only the smallest satellites, often costing as little as $50,000 (£33,000) each, and also makes parts for bigger ones. The company was the first such to sell its products online. Mr Clark’s firm, which employs 45 people, turned over £3m this year, and expects to double that next year.

A few big engineering firms remain in Scotland, such as Babcock Marine and Thales, both of which supply defence equipment. But most of the country’s 7,500 engineering companies belong to a long, thin tail. Often family-owned and generations old, the best of them combine technological savvy with a strong entrepreneurial spirit. Often, they are niche manufacturers to the world.

One such is Castle Precision Engineering, in south-west Glasgow. It started out in 1951 making machines for the giant local Singer sewing-machine factory, then moved into car parts, medical equipment and aerospace—now its biggest market. On March 9th it created the fastest wheels ever made, for the “Bloodhound” car that will try to set a new land speed record next year. The wheels are strong enough to take a driver to 1,000mph in 55 seconds, rotating 177 times a second.

In one respect, these firms are exceptions to the British rule. In a kingdom with a balance-of-trade deficit in goods amounting to fully £10 billion a month, they are fierce exporters. Castle sends about one-third of its wares abroad. Another niche firm, Clark Tracks, which makes caterpillar tracks for forestry vehicles, sells 90% of its products to Europe. Overall, engineering and technology companies account for over one-quarter of Scotland’s exports.

But in another way they illustrate a familiar weakness in British industry. The country’s firms tend to remain small or medium-sized—smaller than the German Mittelstand of export-orientated businesses. Even before the financial crisis Scotland’s small engineering companies found it hard to raise money locally to expand. Some looked overseas instead. Clark Tracks was bought in 2007 by a Swedish company. The defence giant Thales acquired the illustrious old Glaswegian firm of Barr and Stroud in 2000. Its factory, now employing about 700 people, still specialises in submarine periscopes and optronics for the military.

Now change is coming to Scottish engineering, via the North Sea. The oil and gas industry is both a blessing and a curse for engineers. It is a big market for their products, but it also competes fiercely for labour. Glasgow-based companies complain about the shortage of skilled workers even more than do firms elsewhere in Britain. Yan Tiefenbrun, the boss of Castle, got involved in the Bloodhound project to create publicity, hoping talent would be drawn to his apprenticeship scheme. The current woes of Aberdeen’s offshore industry, facing tumbling oil prices and squeezed margins, could be a boon for the country’s other engineers.