For Oxwall, you literally just point the DB to the right server address, where your DB information goes in:
ow_includes/config.php
This is how my setup runs on AWS...
You run the server on EC2 and the DB runs on a separate RDS instance.
Security is a different matter entirely, you must ensure the web server is the only system that is able to communicate with the DB on any network.
The benefits are obvious, if your web server doesn't run your DB also you'll have better performance and more resources available for PHP, but this all depends on network latency between server and DB server.