During last Ubuntu Summit in Riga, I got an interesting question from Alex Lutay, engineering manager at Canonical regarding the different ways to perform some Admin API commands in MySQL Shell.
He wanted to know why, in the manual and blogs, we always use separate commands instead of combining them, as he would expect this to have an impact on the connections established with the server.
Let’s illustrate this by looking at the different ways of obtaining the state of a cluster. Here are the four different methods:
Method 1
This is the method most frequently used in the documentation:
$ mysqlsh admin@10.0.0.1
JS> cluster=dba.getCluster()
JS> cluster.status()
Method 2
This is Alex’s preferred method as he expects to have less round trips with the network:
$ …
[Read more]