create-a-cluster.html 1.4 KB

123456789101112131415161718192021222324252627282930
  1. In Materialize, a [cluster](/concepts/clusters/) is an isolated environment,
  2. similar to a virtual warehouse in Snowflake. When you create a cluster, you
  3. choose the size of its compute resource allocation based on the work you need
  4. the cluster to do, whether ingesting data from a source, computing
  5. always-up-to-date query results, serving results to external clients, or a
  6. combination.
  7. In this step, you'll create a dedicated cluster for ingesting source data from
  8. your PostgreSQL database.
  9. 1. In the [SQL Shell](https://console.materialize.com/), or your preferred SQL
  10. client connected to Materialize, use the [`CREATE CLUSTER`](/sql/create-cluster/)
  11. command to create the new cluster:
  12. ```mzsql
  13. CREATE CLUSTER ingest_postgres (SIZE = '50cc');
  14. SET CLUSTER = ingest_postgres;
  15. ```
  16. A cluster of [size](/sql/create-cluster/#size) `50cc` should be enough to
  17. accommodate multiple PostgreSQL sources, depending on the source
  18. characteristics (e.g., sources with [`ENVELOPE UPSERT`](/sql/create-source/#upsert-envelope)
  19. or [`ENVELOPE DEBEZIUM`](/sql/create-source/#debezium-envelope) will be more
  20. memory-intensive) and the upstream traffic patterns. You can readjust the
  21. size of the cluster at any time using the [`ALTER CLUSTER`](/sql/alter-cluster) command:
  22. ```mzsql
  23. ALTER CLUSTER <cluster_name> SET ( SIZE = <new_size> );
  24. ```