Skip to content

Commit bd1c0c4

Browse files
committed
Sharding get started: update per review
1 parent 196a232 commit bd1c0c4

File tree

1 file changed

+50
-22
lines changed

1 file changed

+50
-22
lines changed

doc/how-to/vshard_quick.rst

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ Here is a schematic view of the cluster's topology:
170170
:end-before: routers:
171171
:dedent:
172172

173-
The main top-level options here are:
173+
The main group-level options here are:
174174

175-
* ``app``: The ``app.module`` option specifies that code specific to storages should be loaded from the ``storage`` module. See also: :ref:`vshard-quick-start-storage-code`.
175+
* ``app``: The ``app.module`` option specifies that code specific to storages should be loaded from the ``storage`` module. This explained below in the :ref:`vshard-quick-start-storage-code` section.
176176
* ``sharding``: The ``sharding.roles`` option specifies that all instances inside this group act as storages.
177177
A rebalancer is selected automatically from two master instances.
178178
* ``replication``: The :ref:`replication.failover <configuration_reference_replication_failover>` option specifies that a leader in each replica set should be specified manually.
@@ -187,9 +187,9 @@ Here is a schematic view of the cluster's topology:
187187
:end-at: 127.0.0.1:3300
188188
:dedent:
189189

190-
The main top-level options here are:
190+
The main group-level options here are:
191191

192-
* ``app``: The ``app.module`` option specifies that code specific to a router should be loaded from the ``router`` module. See also: :ref:`vshard-quick-start-router-code`.
192+
* ``app``: The ``app.module`` option specifies that code specific to a router should be loaded from the ``router`` module. This explained below in the :ref:`vshard-quick-start-router-code` section.
193193
* ``sharding``: The ``sharding.roles`` option specifies that an instance inside this group acts as a router.
194194
* ``replicasets``: This section configures one replica set with one router instance.
195195

@@ -432,22 +432,49 @@ To check the cluster's status, execute :ref:`vshard.router.info() <router_api-in
432432
...
433433
434434
435-
.. _vshard-quick-start-working-adding-data:
436-
437-
Adding data
438-
~~~~~~~~~~~
435+
.. _vshard-quick-start-working-adding-selecting-data:
439436

440-
To check how data is distributed across the cluster's nodes, follow the steps below:
437+
Adding and selecting data
438+
~~~~~~~~~~~~~~~~~~~~~~~~~
441439

442-
1. On the router, call the ``insert_data()`` function:
440+
1. To insert sample data, call the :ref:`insert_data() <vshard-quick-start-router-code>` function on the router:
443441

444442
.. code-block:: console
445443
446444
sharded_cluster:router-a-001> insert_data()
447445
---
448446
...
449447
450-
2. Connect to any storage in the ``storage-a`` replica set:
448+
Calling this function :ref:`distributes data <vshard-quick-start-working-adding-data>` evenly across replica sets.
449+
450+
2. To get a tuple by the specified ID, call the ``get()`` function:
451+
452+
.. code-block:: console
453+
454+
sharded_cluster:router-a-001> get(4)
455+
---
456+
- [4, 'The Beatles', 1960]
457+
...
458+
459+
3. To insert a new tuple, call the ``put()`` function:
460+
461+
.. code-block:: console
462+
463+
sharded_cluster:router-a-001> put(11, 'The Who', 1962)
464+
---
465+
...
466+
467+
468+
469+
470+
.. _vshard-quick-start-working-adding-data:
471+
472+
Checking data distribution
473+
~~~~~~~~~~~~~~~~~~~~~~~~~~
474+
475+
To check how data is distributed across the cluster's nodes, follow the steps below:
476+
477+
1. Connect to any storage in the ``storage-a`` replica set:
451478

452479
.. code-block:: console
453480
@@ -461,15 +488,16 @@ To check how data is distributed across the cluster's nodes, follow the steps be
461488
462489
sharded_cluster:storage-a-001> box.space.bands:select()
463490
---
464-
- - [1, 614, 'Roxette', 1986]
465-
- [2, 986, 'Scorpions', 1965]
466-
- [5, 755, 'Pink Floyd', 1965]
467-
- [7, 998, 'The Doors', 1965]
468-
- [8, 762, 'Nirvana', 1987]
491+
- - [3, 11, 'Ace of Base', 1987]
492+
- [4, 42, 'The Beatles', 1960]
493+
- [6, 55, 'The Rolling Stones', 1962]
494+
- [9, 299, 'Led Zeppelin', 1968]
495+
- [10, 167, 'Queen', 1970]
496+
- [11, 70, 'The Who', 1962]
469497
...
470498
471499
472-
3. Connect to any storage in the ``storage-b`` replica set:
500+
2. Connect to any storage in the ``storage-b`` replica set:
473501

474502
.. code-block:: console
475503
@@ -483,9 +511,9 @@ To check how data is distributed across the cluster's nodes, follow the steps be
483511
484512
sharded_cluster:storage-b-001> box.space.bands:select()
485513
---
486-
- - [3, 11, 'Ace of Base', 1987]
487-
- [4, 42, 'The Beatles', 1960]
488-
- [6, 55, 'The Rolling Stones', 1962]
489-
- [9, 299, 'Led Zeppelin', 1968]
490-
- [10, 167, 'Queen', 1970]
514+
- - [1, 614, 'Roxette', 1986]
515+
- [2, 986, 'Scorpions', 1965]
516+
- [5, 755, 'Pink Floyd', 1965]
517+
- [7, 998, 'The Doors', 1965]
518+
- [8, 762, 'Nirvana', 1987]
491519
...

0 commit comments

Comments
 (0)