thanks for your reply. Yes, I think this is a good point, but there still some issues I'm concerned about. First is the IP-Address my router gets from my ISP, which isn't always the same. Secondly, a VPN allows encryption of the traffic that goes through the internet, and thirdly even if the first issue could be solved using DYNDNS (and they aren't for free anymore like they were in the past) Apple devices like TimeCapsule don't support the necessary reconnect thing. Maybe using the DYNDNS client software could be a solution, but they update the IP-address not on reconnect, they do it on a time base every 10 minutes or so.
Now I try to use tethering with my iPhone connected to my MBP, but the database connection still isn't working.
But maybe there is another way I don't know at the moment, so it would be great if you have a another solution for this kind of problem.