The Topology Service is a set of backend processes running on different servers. Those servers store topology data and provide a distributed locking service.
Vitess uses a plug-in system to support various backends for storing topology data, which are assumed to provide a distributed, consistent key-value store. The default topology service plugin is etcd2.
The topology service exists for several reasons:
It enables tablets to coordinate among themselves as a cluster.
It enables Vitess to discover tablets, so it knows where to route queries.
It stores Vitess configuration provided by the database administrator that is needed by many different servers in the cluster, and that must persist between server restarts.
A Vitess cluster has one global topology service, and a local topology service in each cell.
Each local topology contains information related to its own cell. Specifically, it contains data about tablets in the cell, the keyspace graph for that cell, and the replication graph for that cell.
The local topology service must be available for Vitess to discover tablets and adjust routing as tablets come and go. However, no calls to the topology service are made in the critical path of serving a query at steady state. That means queries are still served during temporary unavailability of topology.