Create a Database: General Flow

1. New Database

Figure 1. Create New Database - Button

Create New Database Button

From the database list view, click the 'New database' button.

2. Database Name

Figure 2. Create New Database - 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

Figure 3. Create New Database - Replication

Configure Replication

  1. 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).

  2. 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.

  3. 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

Figure 4. Create New Database - Path

Configure Path

  1. Set the directory path for the new database's data.
    You can use any of the following options:

    • Write a full path
      (e.g. Windows: C:/MyWork/MyDatabaseFolder, Linux: /etc/MyWork/MyDatabaseFolder )
      The database's data will be stored at the specified location.
    • Write a relative path
      (e.g. MyWork/MyDatabaseFolder)
      The database's data will be stored at the specified location inside your server's data directory (see info below).
    • Leave field empty
      The database's data will be stored in the Databases directory inside your server's data directory.
  2. Information about the path you have chosen for your database's data.

    • Node Tag: your server's cluster node tag - this indicates which server you're creating the new database on.
    • Path: your database data's full path.
    • Free Disk Space: the amount of available space on the local disk.

The Data Directory

  • By default, the server's data directory is at Server/RavenData. This contains a Databases directory, which contains the data of the different databases on the server.
    (e.g. Server/RavenData/Databases/MyDatabaseFolder).
    Learn more at Storage: Directory Structure.
  • The location of the server's data directory can be set in the DataDir configuration option.
  • A path can't start with: $home, ~, or appdrive:.

5. Create

Figure 5. Create New Database - Create

Create Database

Click 'Create' to finish.