# Clustering

## How does SingleStore Helios shard tables?

Every distributed table (except reference tables, which are replicated in whole on each “leaf” node) has a `SHARD KEY` that specifies which columns of a row to hash to determine what *partition* a row should reside in. When rows are inserted into a sharded table, they are hashed by the table’s shard key and sent to the leaf carrying the corresponding partition. This technique is commonly referred to as hash-based partitioning. You can choose how to shard each table by specifying its `SHARD KEY` as part of the `CREATE TABLE` statement. See [Sharding](https://docs.singlestore.com/cloud/getting-started-with-singlestore-helios/about-singlestore-helios/sharding.md) for more details.

## What are aggregator and leaf nodes?

SingleStore Helios stores and computes data on *leaf (A node that stores a subset of a workspace’s data. A leaf node functions as a storage and compute node. To optimize performance, SingleStore automatically distributes data across leaf nodes into partitions. Each leaf node contains several partitions.)* nodes. You can linearly scale both storage and computational power by adding more leaf nodes. Clients query an *aggregator (A node that routes queries to the leaf nodes, aggregates intermediate results, and sends the results back to a client. There are two types of aggregators: master and child.)* node, which in turn queries one or more leaf nodes to collect the rows required to execute the query. Multiple aggregators nodes perform the same functions with respect to executing Data Manipulation Language (DML) queries and allow clients to load-balance queries across the aggregators. Leaf nodes should not be queried directly except for maintenance purposes in exceptional situations.

## What is a “Master Aggregator”?

The Master Aggregator is a specialized aggregator responsible for workspace monitoring and failover.

***

Modified at: July 26, 2024

Source: [/cloud/getting-started-with-singlestore-helios/about-singlestore-helios/singlestore-helios-faqs/clustering/](https://docs.singlestore.com/cloud/getting-started-with-singlestore-helios/about-singlestore-helios/singlestore-helios-faqs/clustering/)

(An index of the documentation is available at /llms.txt)
