Excellent - I think this is a common interest of those developing solutions based on BaseX.
And "as-a-service-optionally-local" might pass as a BaseX Solution design pattern.
Hans-Jürgen
(PS Sometimes the most straightforward ideas come to mind last, or late.)