Back to Materialize

CREATE CLUSTER REPLICA

doc/user/content/sql/create-cluster-replica.md

1233.4 KB
Original Source

CREATE CLUSTER REPLICA provisions a new replica for an unmanaged cluster.

{{< tip >}} When getting started with Materialize, we recommend starting with managed clusters. {{</ tip >}}

Syntax

{{% include-syntax file="examples/create_cluster_replica" example="syntax" %}}

Details

Size

The SIZE option for replicas is identical to the SIZE option for clusters option, except that the size applies only to the new replica.

{{< tabs >}} {{< tab "M.1 Clusters" >}}

{{< include-md file="shared-content/cluster-size-disclaimer.md" >}}

{{< yaml-table data="m1_cluster_sizing" >}}

{{< /tab >}}

{{< tab "Legacy cc Clusters" >}}

Materialize offers the following legacy cc cluster sizes:

{{< tip >}} In most cases, you should not use legacy sizes. M.1 sizes offer better performance per credit for nearly all workloads. We recommend using M.1 sizes for all new clusters, and recommend migrating existing legacy-sized clusters to M.1 sizes. Materialize is committed to supporting customers during the transition period as we move to deprecate legacy sizes.

The legacy size information is provided for completeness. {{< /tip >}}

  • 25cc
  • 50cc
  • 100cc
  • 200cc
  • 300cc
  • 400cc
  • 600cc
  • 800cc
  • 1200cc
  • 1600cc
  • 3200cc
  • 6400cc
  • 128C
  • 256C
  • 512C

The resource allocations are proportional to the number in the size name. For example, a cluster of size 600cc has 2x as much CPU, memory, and disk as a cluster of size 300cc, and 1.5x as much CPU, memory, and disk as a cluster of size 400cc. To determine the specific resource allocations for a size, query the mz_cluster_replica_sizes table.

{{< warning >}} The values in the mz_cluster_replica_sizes table may change at any time. You should not rely on them for any kind of capacity planning. {{< /warning >}}

Clusters of larger sizes can process data faster and handle larger data volumes. {{< /tab >}} {{< /tabs >}}

See also:

Homogeneous vs. heterogeneous hardware provisioning

Because Materialize uses active replication, all replicas will be instructed to do the same work, irrespective of their resource allocation.

For the most stable performance, we recommend using the same size and disk configuration for all replicas.

However, it is possible to use different replica configurations in the same cluster. In these cases, the replicas with less resources will likely be continually burdened with a backlog of work. If all of the faster replicas become unreachable, the system might experience delays in replying to requests while the slower replicas catch up to the last known time that the faster machines had computed.

Example

mzsql
CREATE CLUSTER REPLICA c1.r1 (SIZE = 'M.1-large');

Privileges

The privileges required to execute this statement are:

{{% include-headless "/headless/sql-command-privileges/create-cluster-replica" %}}

See also