Hi Ben, 



Am 30.07.2020 um 22:23 schrieb Ben Pracht <ben.pracht@gmail.com>:

* From testing, it appears that the basexhttp server also starts the database server.  From the options available in .basex, I was under the impression I had to start basexserver separately, but when I tried to run basexserver and subsequently basexhttp, the basexhttp server said the port was already in use.  

Yes that is right; it will start both the HTTP-Server and the BaseX Server
https://docs.basex.org/wiki/Web_Application
An instance of the Jetty Web Server will be started, which by default listens to the port 8984. Additionally, the BaseX Database Server will be started, accessible on port 1984. The command-line output will look something like that (the JSP warning message can be ignored):




* It's probably obvious to people who write RESTXQ code readily, but it seems worthwhile to note that the services run on the basexhttp server JVM, and not the basexserver JVM.  Because I anticipate needing multiple databases, I'm trying to set up the server so that it can fork work over to the appropriate database.  It would be nice if I could have XQUERY code running at the basexserver JVM.

This might be a little more work, you could start multiple BaseXServer Instances and use the client module [1] to connect to these instances and run queries on them.
https://docs.basex.org/wiki/Client_Module


So you’d basically have an restxq endpoint, and the endpoint decides which query to send to which basexserver via the client module.



* In my .basex file, I specify 
HOST=localhost
PORT=1984
SERVERPORT=1984
SERVERHOST=localhost

Since it's the basexhttp that starts the basexserver, it's not clear to me which is considered the server, but nonetheless, somehow I'm able to get the above to at least partially function, though I'm confident that I did this wrong.  

The options are explained here, 

https://docs.basex.org/wiki/Options#Client.2FServer_Architecture

basexclient uses these options: 
HOST: This host name is used by the client when connecting to a server. 
PORT: This port is used by the client when connecting to a server.

basexserver uses these options:
SERVERPORT: This is the port the database server will be listening to.
SERVERHOST:  This is the host name or ip address the server is bound to

IIRC these Options originated in the times before basexhttp / RestXQ :-)


* I noticed there's a REST and a RESTXQ, for most part would I always want to use RESTXQ?

RestXQ is way more flexible (in my opinion ;-)) and a lot more developer accessible (again in my opinion) for building web applications. 


I hope those who write the documentation do not take offense to my questions.
Not at all  :)
I'm not sure I would have thought to document it or how to write it in such a way that it doesn't get asked.
I think the many possibilities and features make it very hard to convey all the information needed at any time :-)

This project is one of the best documented in the OSS community, and even better than some products for which money changes hands.
Thank you very much! :)

Thanks,
Ben
Hope this helps!
Michael