Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
docs: upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
planetscale-actions-bot committed Sep 23, 2024
1 parent 4c19fa8 commit 5af03b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docs/concepts/cluster-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ To create a new [keyspace](/docs/sharding/keyspaces):
5. Enter the keyspace name. For example, if your existing unsharded keyspace is named `books`, you may create a sharded keyspace named `books-sharded`.
6. Select whether you want to keep it unsharded, or, if not, select the number of shards you to exist in this keyspace. In most cases, you will be adding a new sharded keyspace. Adding a new unsharded keyspace is not a common use case.

**Note**: The cost of adding this additional keyspace largely depends on the number of shards you choose, the cluster size, and if you'd like to add additional replicas.
{% callout type="note" %}
The cost of adding this additional keyspace largely depends on the number of shards you choose, the cluster size, and if you'd like to add additional replicas.
{% /callout %}

7. Choose the cluster sizes you would like to use for this keyspace. Keep in mind, if you are creating a sharded keyspace, this will spin up multiple clusters of the selected size. For example, if you are creating 4 shards and choose the `PS-80` cluster size, we will create 4 `PS-80`s, each with 1 primary and 2 replicas.
8. Select the number of _additional_ replicas, if any, that you'd like to add to each cluster. Each cluster comes with 2 replicas by default, so any number you choose will be in addition to those 2.
Expand All @@ -53,7 +55,9 @@ To create a new [keyspace](/docs/sharding/keyspaces):

## Modify the VSchema of a keyspace via cluster configuration tab

**Note**: You can modify the VSchema on your development branch either in the cluster configuration tab, using the [`ALTER VSCHEMA` command](/docs/sharding/vschema#modifying-vschema), or with the pscale CLI using [`pscale keyspace vschema update`](/docs/reference/keyspace).
{% callout type="note" %}
You can modify the VSchema on your development branch either in the cluster configuration tab, using the [`ALTER VSCHEMA` command](/docs/sharding/vschema#modifying-vschema), or with the pscale CLI using [`pscale keyspace vschema update`](/docs/reference/keyspace).
{% /callout %}

Once you have created your keyspace, you will see a new tab: **VSchema**. The VSchema contains information about how the keyspace is sharded, sequence tables, and other Vitess schema information. The VSchema tab allows you to configure the Vschema for your new keyspace or modify it for existing keyspaces.

Expand Down
3 changes: 2 additions & 1 deletion docs/sharding/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ When you're at the point where you've maxed out your vertical scaling efforts an

## How does our sharding process work?

When it comes time to shard your database, you'll work closely with our Technical Solutions team to identify the best [sharding scheme](https://vitess.io/docs/reference/features/sharding/#sharding-scheme) for your database.
When it comes time to shard your database, we recommend following our [sharding quickstart](/docs/sharding/sharding-quickstart) guide. You may also
contact our [Technical Solutions team](/contact) to identify the best [sharding scheme](https://vitess.io/docs/reference/features/sharding/#sharding-scheme) for your database.

PlanetScale uses an explicit sharding system.
This means that, if you are going to horizontally shard your data, we have to tell Vitess which sharding strategy to use for each sharded table.
Expand Down
5 changes: 3 additions & 2 deletions docs/sharding/sharding-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CREATE TABLE user(
```sql
CREATE TABLE exercise_log(
log_id BIGINT UNSIGNED AUTO_INCREMENT,
user_id BIGINT,
user_id BIGINT UNSIGNED,
reps SMALLINT,
created_at DATETIME,
edited_at DATETIME,
Expand All @@ -97,8 +97,9 @@ CREATE TABLE exercise_log(
);
```

However, we need to get rid of the `AUTO_INCREMENT`s in favor of [sequence tables](/docs/sharding/sequence-tables) in order to get this horizontally sharded.
However, we need to replace the `AUTO_INCREMENT`s in favor of [sequence tables](/docs/sharding/sequence-tables) in order to horizontally shard the tables.
To do this, we'll first create the tables in the sharded keyspace with the `AUTO_INCREMENT`s removed.

Connect to your PlanetScale database and run the following:

```sql
Expand Down

0 comments on commit 5af03b8

Please sign in to comment.