title: How can I use MySQL database from two different server in PHP?
body: <p>I am trying to make a webapp using PHP and MySQL in backend. I want to know that how can I use two MySQL servers to fetch data. Because I am going to use two domains for apps. So when my first sql database will get to its limit, I will need to use another server. So how can I fetch data from all servers? I am gonna use user signup and login system and then other their document information and all. So any suggestion for me? Do you think that I should use user details on a single server and other details of documents on another server?</p>
  
  <p>My question might be confusing so let me try to explain more.</p>
  
  <p>See, I am going to use two domains. Domain1 and Domain2</p>
  
  <p>People will be able to register from both domains to access both apps. (like google's apps e.g. gmail, youtube, adsense, adwords and all)</p>
  
  <p>Domain1 will make shorten urls, Domain2 will allow to manage files. And also Domain2 will generate shorten link to download those files. so people can upload files from Domain1 and it will generate shorten urls like Domain1/f/123456. Something like that, so any suggestion for apps? </p>