The vconfig element
To facilitate multi-tenancy on the C-Phrase Host, there is a virtual config element (
vconfig) which lets
you run NLIs which
use a common .cphrase file, although with a different database connection specification. These virtual configurations,
like regular configurations, have a set of corpus and parameter files,
but when it loads the table definitions, it does so using a full
config configuration specification.
By changing the database usernames across a set of virtual configurations, you may run multiple tenants using the
same core configuration and database.
<!ELEMENT vconfig> <!ATTLIST vconfig id CDATA #REQUIRED db CDATA #REQUIRED configuration CDATA #IMPLIED>
id is the identifier of the virtual configuration. The folder and .cphrase and .py files associated with this configuration will all use this identifier.
db specifies how to connect to the underlying database. This is exactly as done with normal configurations.
configuration specifies which configuration should be used to define the tables, views, reports, etc. of the configuration that the virual configuration will be over.
As an example assume we have a full configuration
FH that connects to a remote SQL Server database named
'fhistory'. Assume that
users on that remote database are named
reader2, ... and are configured to run
as separate tenants. Given this, for the third tenant, assume we have a C-Phrase configuration with the name
FH_T3 and within it
the contents of the
FH_T3.cphrase are exactly:
<vconfig id="FH_T3" db="sqlserver:user=reader3,password=mongoose-wesfsf,database=fhistory,host=126.96.36.199,port=1433" configuration="FH_Main" />
When you launch this configuration and the user connects to it, they will be operating as user
and will thus run a tenant 3. Sharing NLI parameters, corpus files, etc. can be achieved via logging into the C-Phrase host,
going to the configs directory and setting up symbolic links from tenant configuations into the main configuration directory.