So Vitess was created to run in conjunction with MySQL to offer additional management capabilities. The Vtocc component, for example, consolidates thousands of incoming SQL queries into a smaller number of batches so MySQL can take fewer resources fulfilling these requests. Vtocc also parses queries so they can be executed more efficiently, and reduces the work caused by duplicate queries by reusing the results from one query to satisfy the other identical requests.
Using Go has allowed YouTube developers to be more productive than they would have been using a more traditional language, Sougoumarane said.
Go code compiles quickly, he said. The 30,000 lines of code in Vitess can be compiled into binaries in about 30 seconds. And, thanks to a rich set of libraries, many tasks do not require that much programming. For instance, Sougoumarane wrote a 105-line routine that periodically trims log files, functionality that couldn't have been written in as few lines by using C or C++.
"That's how expressive Go is," Sougoumarane said. "The language features are well-thought-out. They help you compose things in a much more elegant way than traditional languages." Sougoumarane also praised Go's concurrency support, vital for use in multicore processors. "You don't have to worry about managing threads. Go manages them for you," he said.
The language also has some downsides, too, Sougoumarane admitted. Error handling could be improved, for instance. Scheduling and garbage collection could use some work as well.
Solomon said that, over time, Vitess will take on additional duties, such as database replication and automatic sharding, so a database can grow across multiple servers with no intervention from administrators.