# How to Destroy Valkey Database Clusters Valkey is a high-performance, open-source database that stores key-value data in memory, and is designed for caching, message queues, and primary database use. Fully compatible with Redis, Valkey serves as a drop-in replacement. ## Destroy a Database Cluster Using the CLI or API ## How to Create a Database Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl databases delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/databases/delete/index.html.md) for more details: ```shell doctl databases delete [flags] ``` The following example deletes the database cluster with the ID `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`: ```shell doctl databases delete f81d4fae-7dec-11d0-a765-00a0c91e6bf6 ``` ## How to Destroy a Database Cluster Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/databases/{database_cluster_uuid}`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/databases_destroy_cluster). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```go import ( "context" "github.com/digitalocean/godo" ) func main() { pat := "mytoken" client := godo.NewFromToken(pat) ctx := context.TODO() _, err := client.Databases.Delete(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30") } ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) delete_resp = client.databases.destroy_cluster(database_cluster_uuid="a7abba8") ``` ## Destroy a Database Cluster Using the Control Panel Deleting a database cluster permanently and irreversibly destroys the cluster, its contents, and its automated backups. To destroy a database cluster from the control panel, open the cluster’s **More** menu. Click **Destroy** to go to the cluster’s **Settings** page. ![Screenshot of cluster settings page](https://docs.digitalocean.com/screenshots/databases/valkey-cluster-settings.628e725968226c9ba0980f2cab426d1b8594ceb4f262ddb1b89e98ed2e4579e2.png) In the **Destroy this database cluster** section at the bottom of the page, click the **Destroy** button. This opens a **Destroy database cluster** confirmation window. ![Screenshot of the destroy cluster warning](https://docs.digitalocean.com/screenshots/databases/destroy-cluster-warning.fa56c3f2990f3a2e7d45c017fef6c0c1e2d824c3e3affceabdbe59cf62df8a41.png) To permanently destroy the cluster, type or copy and paste the name of the database cluster into the text field, then click **Destroy**. **Warning**: Destroying a database cluster destroys the backups of that database. Make sure you download any important data before you destroy a cluster.