MaxScale Redundancy Selections with the SkySQL DBaaS API

Overview

This reference page details how to select MaxScale redundancy with the SkySQL DBaaS API for SkySQL.

When selected, MaxScale redundancy provides multiple MaxScale nodes for a service.

MaxScale redundancy requires Power tier. When your SkySQL account has Power tier, MaxScale redundancy can be selected during service launch by selecting the number of MaxScale nodes and the instance size for each node.

When your SkySQL account has Foundation tier, MaxScale redundancy can't be selected.

MaxScale redundancy is supported for the Enterprise Server With Replica(s), Xpand Distributed SQL, and ColumnStore Data Warehouse topologies.

With MaxScale redundancy, all nodes are in the same region, but they might be in different zones.

REST Client

A REST client can use the SkySQL DBaaS API to query MaxScale node count and instance size selections for MaxScale redundancy and choose a MaxScale node count and instance size for a new service.

Query MaxScale Node Count Options with REST Client

A REST client can query the SkySQL DBaaS API for the MaxScale node count selections for a specific topology.

To see the available MaxScale node counts for a topology, use curl to call the /provisioning/v1/topologies/${TOPOLOGY}/nodes API endpoint:

$ curl -sS --location \
   --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
   'https://api.mariadb.com/provisioning/v1/topologies/es-replica/nodes' \
   | jq .
[
    {
        "id": "a2e73d6a-ef2d-4643-8836-c42179bf55f8",
        "tier": "foundation",
        "topology": "es-replica",
        "nodes": [
            1,
            2,
            3,
            4,
            5
        ],
        "maxscale_nodes": [
            1,
            2
        ],
        "default_maxscale_nodes": 1
    }
]

Query MaxScale Node Instance Size Options with REST Client

A REST client can query the SkySQL DBaaS API for the MaxScale node instance size selections for a specific cloud provider, architecture, and topology.

To see the default MaxScale instance size for a topology, cloud, and architecture, use curl to call the /provisioning/v1/sizes API endpoint:

$ curl -sS --location \
   --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
   'https://api.mariadb.com/provisioning/v1/sizes?provider=gcp&architecture=amd64&topology=es-replica' \
   | jq .
[
   {
     "id": "c0666ab8-4a3b-11ed-8853-b278760e6ab5",
     "name": "sky-2x8",
     "display_name": "Sky-2x8",
     "service_type": "transactional",
     "provider": "gcp",
     "tier": "foundation",
     "architecture": "amd64",
     "cpu": "2 vCPU",
     "ram": "8 GB",
     "type": "server",
     "default_maxscale_size_name": "sky-2x8",
     "updated_on": "2022-10-12T14:40:00Z",
     "created_on": "2022-10-12T14:40:00Z",
     "is_active": true,
     "topology": "es-replica"
   }
]

The default_maxscale_size_name attribute shows the default MaxScale instance size.

To see the available MaxScale node instance sizes for a topology, use curl to call the /provisioning/v1/sizes API endpoint with type=proxy set:

$ curl -sS --location \
   --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
   'https://api.mariadb.com/provisioning/v1/sizes?architecture=amd64&service_type=transactional&provider=gcp&topology=es-replica&type=proxy' \
   | jq .

The output can show different instance sizes, depending on whether your SkySQL account is Foundation tier or Power tier.

For the MaxScale node instance size that you would like to select, extract the name attribute from the output and provide that value to the /provisioning/v1/services API endpoint as the maxscale_size attribute.

Select Option with REST Client

When using a REST client and your SkySQL account has Power tier, select the number of MaxScale nodes and the instance size for each node by calling the /provisioning/v1/services API endpoint with the maxscale_size and maxscale_nodes attributes set.

For example, prepare a request body containing the desired service options in a file called request-service.json:

$ cat > request-service.json <<EOF
{
  "service_type": "transactional",
  "topology": "es-replica",
  "provider": "gcp",
  "region": "us-central1",
  "architecture": "amd64",
  "size": "sky-2x8",
  "storage": 100,
  "nodes": 3,
  "version": "10.6.11-6-1",
  "maxscale_size": "sky-2x8",
  "maxscale_nodes": 2,
  "name": "skysql-nr-quickstart",
  "ssl_enabled": true
}
EOF

Then use curl to call the /provisioning/v1/services API endpoint to create (launch) a new database service and save the response to the response-service.json file:

$ curl -sS --location --request POST \
   --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
   --header "Accept: application/json" \
   --header "Content-type: application/json" \
   --data '@request-service.json' \
   https://api.mariadb.com/provisioning/v1/services \
   | tee response-service.json | jq .

Upon success, the command will return JSON with details about the new service.

Terraform

Terraform can use the SkySQL Terraform provider to choose a MaxScale node count and instance size for a new service. When using Terraform and your SkySQL account has Power tier, select the number of MaxScale nodes and the instance size for each node using the maxscale_size and maxscale_nodes attributes for the skysql_service resource:

# Create a service
resource "skysql_service" "default" {
  service_type        = "transactional"
  topology            = "es-replica"
  cloud_provider      = "gcp"
  region              = "us-central1"
  architecture        = "amd64"
  size                = "sky-2x8"
  storage             = 100
  nodes               = 3
  version             = "10.6.11-6-1"
  maxscale_size       = "sky-2x8"
  maxscale_nodes      = 2
  name                = "skysql-nr-quickstart"
  ssl_enabled         = true
  deletion_protection = true
  wait_for_creation   = true
  wait_for_deletion   = true
  wait_for_update     = true
  is_active           = true
}

Available Options

MaxScale Instance Sizes

Instance size choices are specific to the cloud provider, topology, region, and hardware architecture.

When your SkySQL account has Power tier, the following instance sizes can be selected for MaxScale nodes:

Instance Size

Cloud Provider

CPU

Memory

sky-2x4

aws

2 vCPU

4 GB

sky-2x8

gcp

2 vCPU

8 GB

sky-4x16

aws

4 vCPU

16 GB

sky-4x16

gcp

4 vCPU

16 GB

sky-8x32

aws

8 vCPU

32 GB

sky-8x32

gcp

8 vCPU

32 GB

sky-16x64

aws

16 vCPU

64 GB

sky-16x64

gcp

16 vCPU

64 GB

sky-32x128

aws

32 vCPU

128 GB

sky-32x128

gcp

32 vCPU

128 GB

sky-64x256

aws

64 vCPU

256 GB

sky-64x256

gcp

64 vCPU

256 GB