Skip to content

region_sharding: update tutorial to show resharding#488

Merged
deepthi merged 2 commits intoprodfrom
ds-region-sharding-update
Aug 18, 2020
Merged

region_sharding: update tutorial to show resharding#488
deepthi merged 2 commits intoprodfrom
ds-region-sharding-update

Conversation

@deepthi
Copy link
Copy Markdown
Collaborator

@deepthi deepthi commented Aug 17, 2020

Signed-off-by: deepthi deepthi@planetscale.com

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 17, 2020

Deploy preview for vitess ready!

Built with commit 686047f

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

Signed-off-by: deepthi <deepthi@planetscale.com>
@deepthi deepthi force-pushed the ds-region-sharding-update branch from 6c1eea3 to b45bb5b Compare August 17, 2020 16:03
Copy link
Copy Markdown
Contributor

@jmoldow jmoldow left a comment

Choose a reason for hiding this comment

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

As I suggested in the other PR:

I'm curious to see a discussion in the tutorial on the sharding strategy for the lookup table.

  • Discussion about the latency implications of going cross-shard (and likely cross-region) in order to query the id lookup table.
  • Tradeoffs of cross-replicating every lookup table shard into every region. What are the problems that come up here, with regards to consistency, in the face of replication lag.

In this example, we are using 1 byte to represent a country code. You can use 1 or 2 bytes. With 2 bytes, 65536 distinct locations can be supported. The byte value of the country(or other location identifier) is prefixed to a hash value computed from the id to produce the keyspace_id.
This will be primary vindex on the `customer` table. As such, it is sufficient for resharding, inserts and selects.
However, we don't yet support updates and deletes using a multi-column vindex.
In order for those to work, we need to create a lookup vindex that can used to find the correct rows by id.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we also need the lookup vindex so that selects that don't include the country can be done efficiently?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I'll update.

},
"tables": {
"customer": {
"columnVindexes": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be column_vindexes? That is how it appears everywhere else in this tutorial.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's what I thought too, but this is what is returned by running the command.

@@ -0,0 +1,294 @@
---
title: Region-based Sharding
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this go under 6.0, since the new guide is for 7.0?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The example in the 7.0 release is still the old one. Updated example will only be available on master.

@deepthi
Copy link
Copy Markdown
Collaborator Author

deepthi commented Aug 17, 2020

As I suggested in the other PR:

I'm curious to see a discussion in the tutorial on the sharding strategy for the lookup table.

  • Discussion about the latency implications of going cross-shard (and likely cross-region) in order to query the id lookup table.
  • Tradeoffs of cross-replicating every lookup table shard into every region. What are the problems that come up here, with regards to consistency, in the face of replication lag.

We are working on a separate page for lookup vindexes. TBH I still need to work out some of the answers, we'll make sure to include them on that page and update this page once I have them.

…re efficient

Signed-off-by: deepthi <deepthi@planetscale.com>
@deepthi deepthi merged commit 40e7bb4 into prod Aug 18, 2020
@deepthi deepthi deleted the ds-region-sharding-update branch December 16, 2021 18:42
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.

3 participants