Hi,
I'm working on this POC of a XML-database application with a web based frontend in Basex.
I have a few questions:
- what is the difference between the rest- and the restxq- prefix? Do they refer to different namespaces?
- should I call database-functions in the backend- server through a client-server connection? If I call the database functions directly from my restxq-functions it just works. But is this a correct configuration in a multi-user environment?
- in case of adding or changing data in the database, is it possible to retrieve the saved data form the dababase in the same session and return it to the webpage? The saved data is enriched with f.e. an unique identification that I want to return to the webpage.
TIA for yout reply.
Rob Stapper
Hi Rob,
- what is the difference between the rest- and the restxq- prefix? Do they
refer to different namespaces?
Yes they do. 'rest' is the one we recommend.
- should I call database-functions in the backend- server through a
client-server connection? If I call the database functions directly from my restxq-functions it just works. But is this a correct configuration in a multi-user environment?
That’s an interestig point. If you follow the traditional 3-tier-architecture, it makes sense to have two BaseX instances: One for the application logic (restxq), the other one for data. The decision mostly depends on your use case, its complexity, number of users, etc: It is always easier to only have one layer, but if it turns out that you need to maximize parallel access, updates in a single sayer may block other operations. If all data is stored in a data layer, all queries of your application layer will be non-updating and, thus, better parallelizable.
- in case of adding or changing data in the database, is it possible to
retrieve the saved data form the dababase in the same session and return it to the webpage? The saved data is enriched with f.e. an unique identification that I want to return to the webpage.
Do you mean that you want to save data and return it to the client? Yes, that’s possible; db:output [1] should do the job.
Hope this helps, Christian
basex-talk@mailman.uni-konstanz.de