region_sharding: update tutorial to show resharding#488
Conversation
|
Deploy preview for vitess ready! Built with commit 686047f |
Signed-off-by: deepthi <deepthi@planetscale.com>
6c1eea3 to
b45bb5b
Compare
jmoldow
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Don't we also need the lookup vindex so that selects that don't include the country can be done efficiently?
There was a problem hiding this comment.
Good point. I'll update.
| }, | ||
| "tables": { | ||
| "customer": { | ||
| "columnVindexes": [ |
There was a problem hiding this comment.
Is this supposed to be column_vindexes? That is how it appears everywhere else in this tutorial.
There was a problem hiding this comment.
That's what I thought too, but this is what is returned by running the command.
| @@ -0,0 +1,294 @@ | |||
| --- | |||
| title: Region-based Sharding | |||
There was a problem hiding this comment.
Should this go under 6.0, since the new guide is for 7.0?
There was a problem hiding this comment.
The example in the 7.0 release is still the old one. Updated example will only be available on master.
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>
Signed-off-by: deepthi deepthi@planetscale.com