

# Using DFS Namespaces
<a name="using-dfs-namespaces"></a>

DFS Namespaces is a Windows Server role service that you use to group shared folders located on different servers into one or more logically structured namespaces. This makes it possible to give users a virtual view of shared folders, where a single path leads to files located on multiple file systems, as shown in the following diagram. In addition to organizing and unifying access to your file shares across multiple file systems, 

## Group multiple FSx for Windows File Server file systems with DFS Namespaces
<a name="group-file-systems"></a>

You can use Microsoft's Distributed File System (DFS) Namespaces to group file shares on multiple FSx for Windows File Server file systems into one common folder structure, or namespace. Using DFS Namespaces, you can scale file storage beyond the maximum storage capacity of single file system (64 TiB) for large file datasets—up to hundreds of petabytes. This section shows you how to set up DFS namespaces on multiple FSx for Windows File Server file systems.

DFS Namespaces is a Windows Server role service that you use to group shared folders located on different servers into one or more logically structured namespaces. This makes it possible to give users a virtual view of shared folders, where a single path leads to files located on multiple file systems, as shown in the following diagram. In addition to organizing and unifying access to your file shares across multiple file systems, 

![\[Diagram displaying the process of creating a single namespace on two namespace servers.\]](http://docs.aws.amazon.com/fsx/latest/WindowsGuide/images/FSx-common-namespace.png)


For a step-by-step procedure for grouping FSx for Windows file systems using DFS Namespaces, see [Group multiple file systems under a single namespace](group-fsx-namespace.md).

## Improving performance with shards
<a name="scale-out-performance"></a>

Amazon FSx for Windows File Server supports the use of the Microsoft Distributed File System (DFS). By using DFS Namespaces, you can scale out performance (both read and write) to serve I/O-intensive workloads by spreading your file data across multiple Amazon FSx file systems. At the same time, you can still present a unified view under a common namespace to your applications. This solution involves dividing your file data into smaller datasets or *shards* and storing them across different file systems. Applications accessing your data from multiple instances can achieve high levels of performance by reading and writing to these shards in parallel.

You can use the solution provided in [Sharding data using DFS Namespaces for scale-out performance](scaleout-performance.md) to distribute read/write access to your data uniformly across your data multiple FSx for Windows File Server file systems.

# Group multiple file systems under a single namespace
<a name="group-fsx-namespace"></a>

In this procedure, you will create a single domain-based namespace (`example.com\corp`) on two namespace servers, in order to consolidate file shares stored on multiple FSx for Windows file systems (finance, marketing, sales, home\$1directories). You will also set up four file shares under the namespace, each transparently redirecting users to shares hosted on separate FSx for Windows file systems. This enables your users to access file shares using a common namespace instead of having to specify the DNS names for each of the file systems hosting the file shares.

**Note**  
Amazon FSx cannot be added to the root of the DFS share path.

**To group multiple file systems into a common DFS namespace**

1. If you don't already have DFS Namespace servers running, you can launch a pair of highly available DFS Namespace servers using the [setup-DFSN-servers.template](https://solution-references.s3.amazonaws.com/fsx/dfs/setup-DFSN-servers.template) CloudFormation template. For more information on creating an CloudFormation stack, see [Creating a Stack on the AWS CloudFormation Console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) in the *AWS CloudFormation User Guide*.

1. Connect to one of the DFS Namespace servers launched in the previous step as a user in the **AWS Delegated Administrators** group. For more information, see [Connecting to Your Windows Instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html) in the *Amazon EC2 User Guide*.

1. Access the DFS Management Console by opening. Open the **Start** menu and run **dfsmgmt.msc**. This opens the DFS Management GUI tool.

1. Choose **Action** then **New Namespace**, type in the computer name of the first DFS Namespace server you launched for **Server** and choose **Next**.

1. For **Name**, type in the namespace you're creating (for example, **corp**).

1. Choose **Edit Settings** and set the appropriate permissions based on your requirements. Choose **Next**.

1. Leave the default **Domain-based namespace** option selected, leave the **Enable Windows Server 2008 mode** option selected, and choose **Next**.
**Note**  
Windows Server 2008 mode is the latest available option for Namespaces.

1. Review the namespace settings and choose **Create**.

1. With the newly created namespace selected under **Namespaces** in the navigation bar, choose **Action** then **Add Namespace Server**.

1. Type in the computer name of the second DFS Namespace server you launched for **Namespace server**.

1. Choose **Edit Settings**, set the appropriate permissions based on your requirements, and choose **OK**.

1. Open the context (right-click) menu for the namespace you just created, choose **New Folder**, type in the name of the folder (for example, `finance` for **Name**, and choose **OK**.

1. Type in the DNS name of the file share that you want the DFS Namespace folder to point to in UNC format (for example, `\\fs-0123456789abcdef0.example.com\finance`) for **Path to folder target** and choose **OK**.

1. If the share doesn't exist:

   1. Choose **Yes** to create it.

   1. From the **Create Share** dialog, choose **Browse**.

   1. Choose an existing folder, or create a new folder under **D\$1**, and choose **OK**.

   1. Set the appropriate share permissions, and choose **OK**.

1. From the **New Folder** dialog, choose **OK**. The new folder will be created under the namespace.

1. Repeat the last four steps for other folders you want to share under the same namespace.

# Sharding data using DFS Namespaces for scale-out performance
<a name="scaleout-performance"></a>

The following procedure guides you through creating a DFS solution on Amazon FSx for scale-out performance. In this example, the data stored in the *corp* namespace is sharded alphabetically. Data files ‘A-F’, ‘G-M’ and ‘N-Z’ are all stored on different file shares. Based on the type of data, I/O size, and I/O access pattern, you should decide how to best shard your data across multiple file shares. Choose a sharding convention that distributes I/O evenly across all the file shares you plan on using. Keep in mind that each namespace supports up to 50,000 file shares and hundreds of petabytes of storage capacity in aggregate.

![\[Diagram showing the configuration of a DFS solution on Amazon FSx for scale-out performance.\]](http://docs.aws.amazon.com/fsx/latest/WindowsGuide/images/FSx-scale-out-performance.png)


**To set up DFS Namespaces for scale-out performance**

1. If you don't already have DFS Namespace servers running, you can launch a pair of highly available DFS Namespace servers using the [setup-DFSN-servers.template](https://s3.amazonaws.com/solution-references/fsx/dfs/setup-DFSN-servers.template) CloudFormation template. For more information on creating an CloudFormation stack, see [Creating a Stack on the AWS CloudFormation Console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) in the *AWS CloudFormation User Guide*.

1. Connect to one of the DFS Namespace servers launched in the previous step as a user in the **AWS Delegated Administrators** group. For more information, see [Connecting to Your Windows Instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html) in the *Amazon EC2 User Guide*.

1. Access the DFS Management Console. Open the **Start** menu and run **dfsmgmt.msc**. This opens the DFS Management GUI tool.

1. Choose **Action** then **New Namespace**, type in the computer name of the first DFS Namespace server you launched for **Server** and choose **Next**.

1. For **Name**, type in the namespace you're creating (for example, **corp**).

1. Choose **Edit Settings** and set the appropriate permissions based on your requirements. Choose **Next**.

1. Leave the default **Domain-based namespace** option selected, leave the **Enable Windows Server 2008 mode** option selected, and choose **Next**.
**Note**  
Windows Server 2008 mode is the latest available option for Namespaces.

1. Review the namespace settings and choose **Create**.

1. With the newly created namespace selected under **Namespaces** in the navigation bar, choose **Action** then **Add Namespace Server**.

1. Type in the computer name of the second DFS Namespace server you launched for **Namespace server**.

1. Choose **Edit Settings**, set the appropriate permissions based on your requirements, and choose **OK**.

1. Open the context (right-click) menu for the namespace you just created, choose **New Folder**, enter the name of the folder for the first shard (for example, `A-F` for **Name**), and choose **Add**.

1. Type in the DNS name of the file share hosting this shard in UNC format (for example, `\\fs-0123456789abcdef0.example.com\A-F`) for **Path to folder target** and choose **OK**.

1. If the share doesn't exist:

   1. Choose **Yes** to create it.

   1. From the **Create Share** dialog, choose **Browse**.

   1. Choose an existing folder, or create a new folder under **D\$1**, and choose **OK**.

   1. Set the appropriate share permissions, and choose **OK**.

1. With the folder target now added for the shard, choose **OK**.

1. Repeat the last four steps for other shards you want to add to the same namespace.