Skip to content

VSchema User Guide: all sections done#643

Merged
sougou merged 17 commits intovitessio:prodfrom
planetscale:ss-ug1-vschema
Jan 12, 2021
Merged

VSchema User Guide: all sections done#643
sougou merged 17 commits intovitessio:prodfrom
planetscale:ss-ug1-vschema

Conversation

@sougou
Copy link
Copy Markdown
Contributor

@sougou sougou commented Dec 20, 2020

This PR is for the vschema user guide part of #642.

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 20, 2020

Deploy preview for vitess ready!

Built with commit 5c41a9a

https://deploy-preview-643--vitess.netlify.app

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou changed the title VSchema User Guide: first two sections VSchema User Guide: first three sections Dec 20, 2020
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou changed the title VSchema User Guide: first three sections VSchema User Guide: first few sections Dec 21, 2020
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@systay systay requested a review from a team December 23, 2020 16:15
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou changed the title VSchema User Guide: first few sections VSchema User Guide: all sections done Dec 28, 2020
Copy link
Copy Markdown
Member

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very well explained and thorough!

Some minor typos need to be addressed.

weight: 2
---

One of the goals for vitess is to provide a unified view for a large number of mysql clusters distributed across multiple data centers and regions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are multiple places in this guide where vitess and mysql are used: should it be Vitess and MySQL?


The demo describes the VSchema JSON syntax. Many of the changes can be executed by issuing special DDL commands that Vitess understands. Wherever applicable, we have provided the equivalent DDL construct you could apply if you were running a live system. All the DDLs are also listed in the `vschema_ddls.sql` file.

It is generally recommeded that you get familiar with the JSON syntax as it will be useful for troubleshooting if something does not work as intended.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: recommeded => recommended


In this logical view, a vitess keyspace is the equivalent of a mysql database. In many cases, this is a one-to-one mapping where a keyspace directly corresponds to a physical mysql server with a single database. However, a vitess keyspace can also be sharded. If so, a single keyspace would map to multiple mysql servers behind the scenes.

The topology is typically spread across multiple Topo Servers: The Global Topo server contains global information, like the list of keyspaces, shards and cells. This information gets deployed into cell-specific topo servers. Each cell specific Topo Server contains additional information about vttablets and mysql servers running in that cell. With this architecture, an outage in one cell does not affect other cells.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one place says "cell specific" instead of "cell-specific"

* The `from` and `to` fields must reference the column names of the lookup table.
* The `owner` field indicates that `corder` is responsible for populating the lookup table and keeping it up-to-date. This means that an insert into `corder` will result in a corresponding lookup row being inserted in the lookup table, etc. Lookup vindexes can also be shared, but they can have only one owner each. We will later see an example about how to share lookup vindexes.

{{ info }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info tags should be {{< info >}} and {{< /info >}}


Creating a lookup vindex after the main table already contains rows does not automatically backfill the lookup table for the existing entries. Only newer inserts cause automatic population of the lookup table. This backfill can be set up using the `CreateLookupVindex` command covered below.

### Check List
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check List should be one word: Checklist


Please refer to [Region-based Sharding](../../configuration-advanced/region-sharding) for an example on how to use the `region_json` vindex.

Currently, the Vindex gets used for assigning a `keyspace_id` at the time of insert and at the time of resharding. Additional vindexes need to be added to the table for routing quer constructs that contain WHERE clauses.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, quer => query

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Copy link
Copy Markdown
Member

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rohit-nayak-ps
Copy link
Copy Markdown
Member

@sougou is it ok to merge this?: you had mentioned you wanted to ask some others to review it. Maybe we can just merge this now, so that it is available, and you can create a follow-up PR.

@sougou sougou merged commit 5d84691 into vitessio:prod Jan 12, 2021
@sougou sougou deleted the ss-ug1-vschema branch January 12, 2021 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants