Create a Database: General Flow
-
From the Studio, the database creation options are:
- Regular database - see below
- Encrypted database - see Encrypted Database
- Create a database from a Backup copy - see From Backup
- Create a database from a Previous RavenDB version database - see From Legacy File
-
In this page:
1. New Database
Create New Database Button
From the databases list view, click the 'New database' button.
2. Database Name
Enter Database Name
- A database name can be any sequence of letters, digits, and characters that match the regex: [ _ \ - \ . ]+
- A name cannot exceed 128 characters
- Spaces are not allowed
- If the name contains
.
, there must be some other character on both sides. -
For example:
- car_orders_2018
- users.payments-2019
3. Configure Replication
Configure Replication
-
Replication Factor:
Set the number of nodes that will contain this database.
The minimum required number is 1.
The maximum number is the cluster size (number of nodes in the cluster). -
Dynamic Database Distribution
Upon a node failure, and if this option is checked, the RavenDB server will automatically replicate the database content to another available node in the cluster, (one that doesn't already contain the database) so that replication factor is maintained. -
Setting Replication Nodes Manually
Select the specific initial replication nodes from the cluster for the database to replicate to.
If no node is checked, then the replication nodes will be selected randomly from the cluster.
4. Configure Path
Configure Path
-
Set the directory path for database data.
-
You can use any of the following options:
- Full path (e.g. Windows: C:/MyWork/MyDatabaseFolder, Linux: /etc/MyWork/MyDatabaseFolder )
The database will be created in this physical location - Relative path (e.g. MyWork/MyDatabaseFolder)
The database will be created under theDataDir
folder - Leave field empty
The Database will be created inDatabases
directory under theDataDir
folder
- Full path (e.g. Windows: C:/MyWork/MyDatabaseFolder, Linux: /etc/MyWork/MyDatabaseFolder )
-
Note:
- The
DataDir
folder can be set in the settings.json configuration file (e.g. "DataDir": "RavenData"). - If
DataDir
is Not specified in the configuration file, then the database will be created under the RavenDB binaries folder
(where the RavenDB dlls are located). - A path can't start with: $home, '~' or 'appdrive:'
- The
5. Create
Create Database
Click 'Create' to finish.