Hi Eric,
As you say, "XML and JSON databases are needed when the data consists of documents already occurring in such formats."
BaseX databases are intended to be representations of physical files,
so what operations are you performing on the databases that are not
easily reproducible from the XML? You say if you move your project to a
new system, you'll "lose all data from the database"--is your goal to
ship out the databases as files for read-only access, without including the
source documents? I'm not a BaseX dev, but I don't think that's its intended use.
Re: "In your model, all copies of my project would access the same database, on the same system." One folder of databases isn't the same as one database. Your project copies can each have their own database within BaseX; they just need to have distinct names like "db-prod" for documents stored in your production folder, "db-dev" for documents stored in your development folder, etc. You can construct your queries to access the database you want at the time by passing an external variable like:
declare variable $d as xs:string external;
for $result in db:open($d)/etc.
In that way you can access data representing files from anywhere on the machine, so it doesn't matter where the encrypted BaseX databases are stored. You can also copy databases into new ones for
manipulation or preservation of a "state" with COPY original_db copied_db. If your changes in original_db get
messed up and you want to restore, DROP DB original_db;
COPY copied_db original_db.
Assuming every distribution of your project will contain the original files, or work based off of user-supplied files, there is no limitation to putting all databases under one directory. Your instructions for installation only need to include specifying that directory in the .basex file, or in a custom file of definitions if you want to set it programmatically; and running a script that constructs the BaseX database on that computer from the documents. Whenever I move our project to a new machine--which I did frequently during development--our scripts rebuilt our databases of ~42K documents, including full-text and custom indexes, in about five minutes.
-Tamara