-
Notifications
You must be signed in to change notification settings - Fork 43
Sharding get started #4042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sharding get started #4042
Conversation
265207e
to
734a3f2
Compare
734a3f2
to
61b936d
Compare
e13e8ba
to
bd37f62
Compare
1e991f8
to
196a232
Compare
bd1c0c4
to
23fed1e
Compare
1c2465e
to
7e58508
Compare
7e58508
to
d4caf1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see some comments from my side.
|
||
All instances are managed using the :ref:`tt <tt-cli>` administrative utility. | ||
.. image:: /book/admin/admin_instances_dev.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to make a separate copy for this tutorial. If we change the pic in the admin guide, we'll definitely forget about this usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the Application environment
topic explicitly says that the sharded_cluster
is used as a demo app:

So, having a separate copy of this image requires updating both images in a case the application is updated. I agree that finding usages of this image becomes complicated, but looks that this is another issue. IMO, it is better to store all images in one directory in our future docs repo, so the path will be the same for all usages.
The :ref:`tt create <tt-create>` command can be used to create an application from a predefined or custom template. | ||
For example, the built-in ``vshard_cluster`` template enables you to create a ready-to-run sharded cluster application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this an admonition for better visibility. And use a stronger wording without for example
: something like tt provides a built-in template vshard_router, which enables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't particularly like the for example
wording. It's a definite an recommended way to create an exact app structure, not an random example.
|
||
2. Inside the ``instances.enabled`` directory of the created tt environment, create the ``sharded_cluster`` directory. | ||
|
||
3. Inside ``instances.enabled/sharded_cluster``, create the following files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe say explicitly that they are empty for now? I've started clicking the links in file descriptions to find out about their content before reading the sentence after the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to Inside the empty ``instances.enabled`` directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean creating empty files. The emptiness of instances directory is pretty obvious :)
When I see an instruction to create a file, I expect next steps with its content right away. Now we're leaving them empty, so it's better to say that it's ok for now, the content will appear later.
|
||
3. Inside ``instances.enabled/sharded_cluster``, create the following files: | ||
|
||
- ``instances.yml`` specifies instances to run in the current environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list look a bit inconsistent
- Articles: with and without
the
in the beginning - Verb form:
specifies
andis intended to store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
doc/how-to/vshard_quick.rst
Outdated
- The ``config.yaml`` file is intended to store the cluster's :ref:`configuration <configuration_overview>`. | ||
- ``storage.lua`` is intended to store code specific for :ref:`storages <vshard-architecture-storage>`. | ||
- ``router.lua`` is intended to store code specific for a :ref:`router <vshard-architecture-router>`. | ||
- ``sharded_cluster-scm-1.rockspec`` includes external dependencies required by the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifies
looks more accurate here. I mean, you declare a name, not download the module here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifies application dependencies
is also shorter and pretty complete)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to specifies external dependencies
because Tarantool also includes "internal" dependencies.
stores code -> contains code
doc/how-to/vshard_quick.rst
Outdated
Resulting configuration | ||
*********************** | ||
|
||
The resulting cluster configuration should look as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add the name config.yaml
name in this sentence or the example itself for those readers who just scroll and quickly scan the page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to:
The resulting ``config.yaml`` file should look as follows:
doc/how-to/vshard_quick.rst
Outdated
:end-at: local vshard | ||
:dedent: | ||
|
||
2. Define the ``put`` function used to write data to a storage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like more context here: say explicitly that this function defines how the router selects the storage to write the data. And the same for reading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function defines how the router selects the storage to write the data
Not exactly, it does two things:
- Calculates a bucket ID used to write data to the correct storage.
- Uses this bucket ID to write data to the storage.
This is what the list after the function definition describes. I'd keep the first sentence short because too much context before the function definition makes it hard to read because of too much technical details.
doc/how-to/vshard_quick.rst
Outdated
Building the application | ||
------------------------ | ||
|
||
In the terminal, open a directory where the :ref:`tt environment is created <vshard-quick-start-creating-app>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directory where the tt environment is created
> the tt environment directory
?
doc/how-to/vshard_quick.rst
Outdated
Bootstrapping a cluster | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To bootstrap the cluster, follow the steps below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add an intro sentence that bootstrap is required? It's not obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrased:
After starting instances, you need to bootstrap the cluster as follows:
Checking status | ||
~~~~~~~~~~~~~~~ | ||
|
||
To check the cluster's status, execute :ref:`vshard.router.info() <router_api-info>` on the router: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any hints what to look at? Now it's a big unfamiliar console output that hardly helps newcomers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the description for each top-level section
43bdb3c
to
808c520
Compare
doc/how-to/vshard_quick.rst
Outdated
|
||
.. _vshard-quick-start-working-adding-selecting-data: | ||
|
||
Adding and selecting data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding and selecting data | |
Writing and selecting data |
808c520
to
981f941
Compare
981f941
to
514b753
Compare
Updated the existing How-to topic to using a new config: https://docs.d.tarantool.io/en/doc/sharding-get-started/how-to/vshard_quick/.
Updated
README
- removed most of the steps that duplicate content from the new topic: https://github.com/tarantool/doc/tree/sharding-get-started/doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster.Some cosmetic changes in the app: updated storage function names to distinguish them from router functions.
Updated
vshard
version to0.1.26
.