vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.48k stars 2.09k forks source link

Vitess dynamic context switch #4920

Open mataneja opened 5 years ago

mataneja commented 5 years ago

Feature Description

As a User (App Developer, Data Engineer, DBA, DBE, SRE) of Vitess, I want to be able to dynamically switch between my Vitess clusters using vtctlclient.

Use Case(s)

Currently, every vtctlclient requires the user to specify the server address aka vtctld. For example:

vtctlclient -server localhost:15999 "$@"

As a user, I'll need to interact with a development, staging and production cluster regularly and will need to dynamically switch between these environments. It will be very useful to specify this information in a config file and be able to switch between them. This will be akin to something like:

vtctlclient context create <>
vtctlclient context use

where context = server configuration and/or any repetitive information needed per command
derekperkins commented 5 years ago

@mataneja I'm not sure if there is anything more to live in context besides what you posted. What prevents you from aliasing your own vtctlprod / vtctldev command? Alternatively, you could just switch an env var like vtctlclient -server $VT_SERVER and use it that way. Do you have something else in mind?

mataneja commented 5 years ago

@derekperkins aliases are not really script-able. Also, we will need to build AuthN/AuthZ support in vtctlclient to support control plane auditing. This will all become extraneous information that will benefit from the same configuration file.