Database configuration
The following topics provide information on configuring the CADMATIC eShare databases.
Permissions
If the eShare installer is to be able to create the main database, or if the eShare server is to be able to create a new project database whenever a new eShare project needs to be established, the database user that eShare logs in as must have appropriate, elevated permissions.
If you manage the databases, you can provide the eShare login with more basic permissions.
Permissions for creating eShare databases
Suitable server-level roles for creating and altering eShare databases include the following:
- sysadmin
- dbcreator
Permissions for running the eShare server
eShare server is a web server application—it responds to requests made by users, but it also runs scheduled maintenance tasks in the background. Accordingly, its application pool in the Internet Information Services (IIS) web server has to be configured to run with such credentials that allow it to access the main database and all project databases, or it needs to be using a connection string that provides such access.
Note: Installing eShare server enables IIS and adds the eShare application pool to it.
eShare server can read, modify, and remove data stored in the main database and in project databases. A suitable database-level role for performing these tasks would include the following:
- db_datareader + db_datawriter
eShare server might also modify the database schema, for example when creating a project, when a created project is accessed for the first time, and when starting the server after an upgrade. A suitable database-level role for performing these tasks would include the following:
- db_ddladmin
Transaction logs
Because eShare can create quite a lot of database traffic, the database transaction logs are by default set to use the Simple recovery model. This minimizes log space consumption, but on the other hand it reduces the chances of recovering from a critical failure.
If your site requires more comprehensive recovery handling or advanced mechanisms such as database mirroring, you can set the recovery model to ‘Full’.
If you do change the recovery model of a database from Simple to Full, you should periodically truncate the transaction logs or schedule transaction log backups to prevent transaction logs from filling up and causing excessive space consumption.
For information on recovery models, refer to Microsoft documentation at https://msdn.microsoft.com/en-us/library/ms189275.aspx.
Main database configuration
Database Name | Connection String | Database Schema | Database Size
Database name
If the eShare installer creates the main database, the database name is "EShare".
If you create the main database, we recommend that you give it the default name "EShare".
Connection string
The connection string for accessing the main database is initially configured by providing the requested information in the eShare installation wizard. The wizard stores the connection string in the IIS server, and you can modify it afterwards if needed (for example, to change the login).
To modify the connection string, open the Connection Strings view of the eShare web site in the Internet Information Services (IIS) Manager application, and double-click the ‘Main’ row. You might need to restart the eShare server for the change to be applied.
If you are required to use Integrated Security (Trusted Connection) for the database connection, connection is established using the identity assigned for the application pool.
To configure the identity of the application pool, open the Application Pools view of Internet Information Services (IIS) Manager, right-click ‘eShareApplicationPool’ and select Advanced Settings, and then set Identity to the appropriate value (default: ApplicationPoolIdentity). You might need to restart the eShare server and recycle the application pool for the change to be applied.
Note: When you change the identity of the application pool, you assign the permissions of that identity to the whole eShare server; to minimize security risks, make sure that the identity does not have excessive permissions. You should also make sure that the identity is permitted to read from the eShare server folder and to read from and write to the ProgramData folder used by eShare server.
Database schema
The main database keeps track of projects, cross-project configurations, users, and permissions in the dbo schema, and that should be the default schema for the login that eShare uses. If the default schema is not configured, dbo is used as the default schema.
Database size
The main database is usually relatively small, ranging from a couple of megabytes to a maximum of a few tens of megabytes, because it only contains data needed to administer and run the eShare server. In practice, the size depends on the number of users and projects that are being stored on the server.
Project database configuration
Database Name | Connection String | Database Schema | Database Properties | Database Size
Database name
If eShare creates the project databases, the database names use the format EShareProject_<id>.
If you create the project databases, we recommend that you establish a naming standard that makes it easy to distinguish the project databases from other databases and also allows applying grouping for the databases via their naming. For example, if you use the format EShare_<project name>, the database name of project "PowerPlant" would be "EShare_PowerPlant". The name can be up to 123 characters long, and it can only consist of alphanumeric and underscore (_) characters.
Connection string
eShare uses the connection string defined for the main database as a template for connecting to project databases. That is, when connecting to a project database, eShare simply replaces the name of the main database in the connection string with the name of the relevant project database.
Database schema
A project database includes project configurations and data in the dbo schema, and it should be the default schema for the login that eShare uses. If the default schema is not configured, dbo is used as the default schema.
Database properties
These properties are enabled by default in project databases—do not disable them:
- Allow Snapshot Isolation
- Is Read Committed Snapshot On
This property is selected by default in project databases—you can change it if needed:
- Recovery model: Simple
Note: If you do need to change the recovery model, see Transaction logs first.
Database size
Most of eShare data is stored in project-specific databases. When eShare imports a 3D model from the CADMATIC EBM format, the data is uncompressed, normalized, and inserted into the relevant project database. EBM is a very compact transfer and storage format for 3D model data, whereas a relational database is less optimal for this type of data. On the other hand, database provides indexing that greatly speeds up data searches.
Depending on the amount of data in the EBM file and on actions performed on the server, project databases might grow fairly large, ranging from a couple of hundred megabytes to several gigabytes. For example, importing a 50 MB *.ebm file might create an approximately 2 GB project database, but if a project administrator uploads a new model, modifies the model, or republishes the model, the project database can contain several models at the same time, and the database size can multiply.
To ensure smooth operation of the server, allow project databases to extend at least three times their original, estimated size.