I WAS in Edinburgh at the weekend, having a wander and visiting a couple of galleries before the hoards descend for the Festival, which kicks off this Friday. Not that the city isn’t already packed with tourists, right enough; the Royal Mile was just about passable as long as you don’t mind being slowed to a crawl by the numerous groups of schoolchildren, family parties and honeymooning couples from all over the world.

In a few days’ time the capital’s narrow, cobbled streets and closes will be even more packed, as performers and audiences swell the population to more than double its usual size. For some, this is all part of Edinburgh’s unique charm as a festival city that welcomes visitors all year round. But for others it is an increasingly unwelcome sight, particularly as it continues to fuel a housing crisis that arguably threatens to change the character of the city forever.

Such language may sound rather dramatic, but when you look beneath the capital’s booming tourist figures – some 3.85 million visitors a year – the accommodation picture that emerges for locals is increasingly bleak.

Research carried out recently by the Scottish Green Party suggests half of all homes in the EH1 postcode will be short-term lets by 2050. High prices already mean only the super-rich and property developers can afford to buy homes, with the sole intention of letting them out - often short-term - at hugely inflated prices. According to local hanging on in areas like the Grassmarket, recent influxes of short-term lets have resulted in noise, disruption and, even more worrying for them, a complete loss of community spirit.

For people moving permanently to the city, meanwhile, or residents looking to move, the shortage of long-term rental properties is pushing up rents to untenable levels.

Short-term letting doesn’t just go on in posh EH1, of course. A recent study revealed more than 6,000 Airbnb listings in Edinburgh, the second highest number outside London. The internet site started small as a way for property owners to swap homes, enjoy a more homely holiday experience and rent out a spare room for a short time; it’s now a global phenomenon worth $30bn that has transformed the holiday market and allows individuals and big companies alike to monetise their properties like never before.

In Edinburgh, almost half of listings are multiple, thus likely to be owned by commercial operators, and more than 50 per cent are for full homes, suggesting the owners, whoever they are, rent for long periods at a time, purely for profit.

Now don’t get me wrong, I’ve used Airbnb many times and stayed in some fantastic pads, the likes of which I’d never have found - or been able to afford - otherwise. You get to live like a local instead of a tourist, which provides a different, invariably more interesting, trip. Once you’ve done Airbnb, you may never go back to hotels, which can seem formal, inconvenient and expensive in comparison.

Quite a few of my friends rent out rooms in their homes on the site from time to time, giving them some handy extra cash. As a freelancer, I may in future be tempted to do the same if times get tough. I can see the attraction of Airbnb from both sides, particularly as the smartphone app which manages transactions is so easy to use. And, of course, it’s hard to argue with the importance to the Scottish economy of the whopping 1.32bn a year spent by tourists in Edinburgh.

But that doesn’t mean there aren’t real and significant concerns inherent in the social and economic freedoms offered by new technology, and our new found vocation as short-term landlords is a prime example.

Can anything be done to prevent cities disadvantaging their own citizens and losing their identity? Berlin, a city of rent caps and anti-gentrification marches, is leading the way on this front, its courts having recently upheld a de facto ban on short-term rentals. Under the ruling, which came into effect in May, those who rent out more than 50 per cent of their property on a short-term basis without a permit risk a fine of £78,000. Council officials say they expect to reject 95 per cent of permit requests and have set up a website where anonymous tip-offs can be left. Many other cities will no doubt we watching what happens with interest.

Back in Edinburgh, the Scottish Greens are calling for more regulation, saying councils must have more say over how properties listed as residential are used. They may well be right. But how do you square that with an owner’s right to make a few quid on their property if they choose, especially during austere times of stagnant wages when such extra income can make the difference?

Scotland is lucky to have beautiful, historic, vibrant cities that people from all over the world want to visit. But first and foremost they must be places to live, work and bring up a family, places with a strong sense of community. That’s surely where a successful future lies, both socially and economically, for any modern city.

With this in mind, Edinburgh must be careful not to kill the goose that lays the golden egg.