The billions of dollars flowing from Japan to the likes of Apple, Amazon and Microsoft might eventually be more of a positive than a negative.

“The digital deficit has grown this much mainly because more companies and individuals are using digital services, meaning digitalization has accelerated, which we believe is a huge plus,” says Kengo Wataya, a researcher at Mitsubishi Research Institute.

Last year, Japan recorded a ¥5.5 trillion ($34 billion) deficit in digital services as huge sums were spent on cloud services, operating systems, email services, social media and internet-based transactions with firms based overseas.