#1 2012-09-24 06:30:04

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Client/Server multi-database

Hi Ab

What I want is a single server instance that allows access to multiple (project) databases. The main reasons for separate (project) databases is taht we want to keep data of different customers physically separated, and also because one may DB be in NexusDB and the other in OracleDB or MS-SQL.

So far we have come to a point where we need to add an URL for each (new) project database created. Unfortunately adding new urls to the http server requires administrative rights which will probably not be available for our server. SO I get the feeling I am on the wrong track here.

So I was thinking of way to access multiple DB's through one url. One client connection will require only one database to be opened, but each client may very well open a different database.

Do you have any tips regarding this?

Regards - Hans

Offline

#2 2012-09-24 12:24:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Client/Server multi-database

You can have a per-table database scheme.
Each external virtual table can be assigned to its own external DB engine.
So you do not  need to add an URL for each (new) project database created.

If your requirement is not at the table level, but at the whole database model level, current implementation scheme is indeed to have several TSQLRestServer instances (each with its own TSQLModel, therefore its own root) on the same TSQLite3HttpServer instance.
So you are right: each TSQLModel expects his own root value, which is expected to be registered.

Usually, you should better run your server as a Windows service - therefore it should be able to run with administrative rights.
If this is an issue, you can register a whole port for all your servers.

What may be implemented on the mORMot side, could be to allow sub-domains in the model root, e.g. /root/sub1 and /root/sub2 so that registering /root should be enough.
I've modified the implementation, so that you can use such "sub-roots".
See http://synopse.info/fossil/info/f454889da1

Offline

#3 2012-09-24 12:29:33

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Re: Client/Server multi-database

I like the idea of sub-domains very much. Thats what we (Bas and I) came up with too as a solution.

It also allows for separation in 'server root' tables (ef the autorization tables) and other tables (my per-project tables)

Thanks!

Offline

#4 2012-09-24 12:35:53

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Client/Server multi-database

Yes, routing in mORMot is very simple and fixed to the domain level.
We may add some more flexible features in the future.

Thanks for the feedback.

Offline

Board footer

Powered by FluxBB