I've written my own dataprovider with localhost and it works well. But if deployed on a customer's premise, the dataprovider has to be the IP address of the server, which we have no control of. If it's a fixed IP address, we can have a setting page that writes to the .env file.
That won't work if it's a dynamic address.