Your DB and Web server belong physically together
Many web/mobile apps are built as a physically separated three-tier in which the web server is hosted at a different machine than the data server. Google it and you’ll get plenty of figures like the one below: