# Manage namespaces

This page describes how to add, remove, and rename namespaces in Aerospike Database clusters.

Aerospike Database clusters contain one or more namespaces, similar to tablespaces in an RDBMS. Namespaces segregate data with different storage requirements, so you can optimize performance by keeping different kinds of data on different kinds of storage hardware.

Namespaces are defined in the main Aerospike [configuration file](https://aerospike.com/docs/database/manage/database/as-config/). You can add, remove, or rename namespaces by editing `aerospike.conf`. You can configure namespaces for optimal performance in a variety of use cases by specifying a [storage engine](https://aerospike.com/docs/database/manage/namespace/storage/config), a [data retention policy](https://aerospike.com/docs/database/manage/namespace/retention), and other parameters.

The Aerospike server reads the configuration file when the server starts. For changes to take effect, stop the server, edit the configuration file, and restart the server. You can perform a rolling restart of cluster nodes to prevent server downtime.

We recommend that you [back up](https://aerospike.com/docs/database/tools/backup-and-restore/asbackup) your cluster before altering your namespace.

## Minimum namespace configuration

The minimum requirement to configure a namespace is to provide it with a name. The following example creates an in-memory namespace with a 1GiB capacity.

```text
namespace NAMESPACE-NAME {

  storage-engine memory {

    data-size 1G               # memory pre-allocated for the data of this namespace

  }

}
```

## Add or remove a namespace

Perform the following steps on the cluster nodes one at a time.

1.  Stop the Aerospike service.
    
    Terminal window
    
    ```bash
    systemctl stop aerospike
    ```
    
2.  Update the `aerospike.conf` file.
    
    Add or remove [`namespace` contexts](https://aerospike.com/docs/database/manage/namespace) as needed.
    
3.  Start the Aerospike service.
    
    Terminal window
    
    ```bash
    systemctl start aerospike
    ```
    

## Rename an existing namespace

It’s not possible to rename an existing namespace in place, but you can create a new namespace with the desired name and move data from an existing namespace into it.

1.  Stop application traffic for the namespace to be renamed.
    
2.  Back up the namespace to be renamed.
    
    You can use [`asbackup` and `asrestore`](https://aerospike.com/docs/database/tools/backup-and-restore/asbackup) for on-demand cluster backup.
    
    Perform the following steps on the cluster nodes one at a time.
    
    1.  Stop the Aerospike service.
        
        Terminal window
        
        ```bash
        systemctl stop aerospike
        ```
        
    2.  Delete stored data for the namespace to be renamed.
        
        If your data is stored in a file, delete the file. For raw devices, use the `blkdiscard` or `dd` Linux utilities. The [Zeroize Multiple SSDs Simultaneously](https://support.aerospike.com/s/article/How-to-zeroize-multiple-storage-devices-simultaneously) Knowledge Base article has more information about deleting data from raw devices.
        
    3.  Modify `aerospike.conf` to update the namespace context.
        
    4.  Start the Aerospike service.
        
        Terminal window
        
        ```bash
        systemctl start aerospike
        ```
        
    5.  Restore the old namespace’s data.
        
        When all the cluster nodes are restarted with the new namespace configuration, use the [`-n`](https://aerospike.com/docs/database/tools/backup-and-restore/asrestore/use#data-selection-options) flag to restore the data and specify the new namespace.
        

When the restore process is complete, the new namespace is ready to use.

## Related topics

-   [Storage engine](https://aerospike.com/docs/database/manage/namespace/storage/config/) configures if records are persisted and where.
-   Configure a [data retention policy](https://aerospike.com/docs/database/manage/namespace/retention) to determine how long records are kept after initially written.
-   [Data durability](https://aerospike.com/docs/database/manage/namespace/durability) determines how many replica copies of a record to keep in the cluster.
-   [Configure strong consistency](https://aerospike.com/docs/database/manage/namespace/consistency) describes how to set up SC mode for transactions.
-   For a complete list of namespace configuration parameters see the [Configuration reference](https://aerospike.com/docs/database/reference/config).