GitHub    Download    Forum
Overview
Tutorial
C++ API
C# API
DTDL
DADL
Setup
DataFS SDK setup
DataFS setup
DataFS Tools
DataFS setup parameters

DataFS setup

This section describes how to create a new database instance.

Logical and physical units

In DataFS, we make a distinction between logical and physical units. Working with data involves working with logical units.
At the top is the "domain". It specifies the "schema" and the topology of the network. Inside the "domain" is one or more "storage" units.
The logical "storage" units are stored in a physical unit (what is known as a "disk"). A "disk" is set up and stored on a server.

Creating a database instance

To create an instance of DataFS, you need to create a domain, a disk, then finally a storage.
All these steps can be performed with the DataFS_Tools installed with the server or by writing your own application and using the IDataFoundationConfiguration interface. The IDataFoundationConfiguration parameters are the same as those used for DataFS_Tools. We will only describe how to use DataFS_Tools in this document.
If you have the server service installed, go to "%ProgramFiles(x86)%\Mobiland DataFS Server" and open DataFS_Tools.exe as an administrator.

Configuration connection

The server uses the address 127.0.0.1 and port 9012 for its configuration interface by default. The user must be an administrator on the machine hosting the server program. If you are not an administrator or run the command from a non-elevated shell, the error 0x80070040 (access denied) will appear.
If you want to change this – for example, if you want to connect to the configuration interface from a remote computer – use the "Set-ConfigBinding" and "Set-ConfigSecurity" commands on this page.

Establishing a connection

To allow client applications to connect, we must first establish a connection with the server program. We can use Open Connection without additional parameters, because we are using the defaults for this example.
Open-Connection

Client connection

Next, we configure a binding. We use "Insert-Binding" to do this. The following example creates a binding without login or encryption activated on the port. (Type 1 means 'Client').
Insert-Binding -Type 1 -Address 192.168.12.43 -Port 9018
Other options can be found here.

Creating a domain

Every storage is part of a domain. The domain defines common settings for all instances, like the schema.
A domain can be created with the following command.
Create-Domain -DomainGuid "{78F18ADB-6F0A-4885-B151-B5A729F35F8B}"
You should use your own newly generated GUID. It can be generated in the likes of Visual Studio using Tools > Create GUID.
A newly created domain is not started automatically. You have to restart the service or start the domain manually. This can be done with the following command.
Start-Domain -DomainGuid "{78F18ADB-6F0A-4885-B151-B5A729F35F8B}"
More information about using the domain can be found here.

Creating a disk

To create a database instance, you need a disk. This can be done with the following command.
Create-Disk -DiskGuid "{EE2AD8F5-5508-4FDE-95E6-0E2AADD06884}" -Path "C:\DataFS\data.datafs"
You should use your own newly generated GUID. It can be generated in the likes of Visual Studio using Tools > Create GUID.
Specify a valid path (you can only use existing directories) for the file; you can name it as you please.
For more information about the "Create-Disk" parameters, refer to the Disk page.

Creating a storage

The main part of a database instance is the storage. This is where data is stored and is the part an application normally communicates with.
A storage can be created with the following command.
Create-Storage -StorageGuid "{1AB45899-3B20-4780-A9F8-9483CC523FC9}" -DiskGuid "{EE2AD8F5-5508-4FDE-95E6-0E2AADD06884}" -DomainGuid "{78F18ADB-6F0A-4885-B151-B5A729F35F8B}" -Name TestDatabase
You should use your own newly generated GUID. It can be generated in the likes of Visual Studio using Tools > Create GUID.
For more information about the "Create-Storage" parameters, refer to the Storage page.

Pass the GUIDs from previous calls for the "DiskGuid" and "DomainGuid" parameters.
A newly created storage is not started automatically. You have to restart the service or start the storage manually. This can be done with the following command.
Start-Storage -StorageGuid "{1AB45899-3B20-4780-A9F8-9483CC523FC9}" -DomainGuid "{78F18ADB-6F0A-4885-B151-B5A729F35F8B}"

Binding BDTD files

Now, everything is ready for a schema to be loaded onto the storage. The schema can be extended by binding all the BDTD files that are generated from compiling your DTDL files.
Extend-Schema -DomainGuid "{78F18ADB-6F0A-4885-B151-B5A729F35F8B}" -BDTD "D:\mySchema.bdtd"

Additional information

About DataFS_Tools

Error codes thrown by DataFS_Tools.exe

All parameters in detail

Binding BDTD files

Now, the server is ready for a schema to be loaded to the storage. The schema can be extended by binding all the BDTD files that are generated when you compile your DTDL files.
Extend-Schema -DomainGuid "{78F18ADB-6F0A-4885-B151-B5A729F35F8B}" -BDTD "D:\mySchema.bdtd"
© 2022 Mobiland AG