LogoLogo
DoltHubBlogDiscordGitHubDolt
  • Introduction
    • What Is Dolt?
    • Installation
      • Linux
      • Windows
      • Mac
      • Build from Source
      • Application Server
      • Docker
      • Upgrading
    • Getting Started
      • Version Controlled Database
      • Git For Data
      • Versioned MySQL Replica
    • Use Cases
      • Data Sharing
      • Data and Model Quality Control
      • Manual Data Curation
      • Version Control for your Application
      • Versioned MySQL Replica
      • Audit
      • Configuration Management
      • Offline First
  • Concepts
    • Dolt
      • Git
        • Commits
        • Log
        • Diff
        • Branch
        • Merge
        • Conflicts
        • Remotes
        • Working Set
      • SQL
        • Databases
        • Schema
        • Tables
        • Primary Keys
        • Types
        • Indexes
        • Views
        • Constraints
        • Triggers
        • Procedures
        • Users/Grants
        • Transactions
        • System Variables
      • RDBMS
        • Server
        • Backups
        • Replication
    • DoltHub/DoltLab
      • Permissions
      • Pull Requests
      • Issues
      • Forks
  • SQL Reference
    • Running the Server
      • Configuration
      • Access Management
      • Branch Permissions
      • Backups
      • Garbage Collection
      • Metrics
      • Replication
      • Troubleshooting
    • Version Control Features
      • Using Branches
      • Merges
      • Querying History
      • Using Remotes
      • Procedures
      • Functions
      • System Tables
      • System Variables
      • Saved Queries
    • SQL Language Support
      • Data Description
      • Expressions, Functions, Operators
      • Supported Statements
      • MySQL Information Schema
      • Collations and Character Sets
      • System Variables
      • Miscellaneous
    • Supported Clients
      • Programmatic
      • SQL Editors
    • Benchmarks and Metrics
      • Correctness
      • Latency
      • Import
  • CLI Reference
    • Commands
    • Git Comparison
  • Architecture
    • Overview
    • Storage Engine
      • Commit Graph
      • Prolly Trees
      • Block Store
    • SQL
      • Go MySQL Server
      • Vitess
  • Guides
    • Cheat Sheet
    • Contributing
      • dolt
      • go-mysql-server
    • MySQL to Dolt Replication
    • Importing Data
    • Integrations
  • Other
    • FAQ
    • Roadmap
    • Versioning
  • Products
    • Hosted Dolt
      • Getting Started
      • Notable Features
      • SQL Workbench
      • Cloning a Hosted Database
      • Using DoltHub as a Remote
      • Infrastructure
    • DoltHub
      • Data Sharing
      • API
        • Authentication
        • SQL
        • CSV
        • Database
        • Hooks
      • Continuous Integration
        • Getting Started
        • Workflow Reference
      • Transform File Uploads
      • Workspaces
    • DoltLab
    • Dolt Workbench
    • DoltgreSQL
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Architecture
  2. SQL

Go MySQL Server

PreviousSQLNextVitess

Last updated 1 year ago

Was this helpful?

is the query engine for Dolt. It's a MySQL compatible parser, server, and query execution engine written in pure Go. As with Dolt, its goal is to be a 100% compatible drop-in replacement for MySQL.

is storage engine agnostic, which means other projects can write their own storage engine plugins to query them via a MySQL connection. There are only two notable backend implementations so far:

  • In-memory database. This ships with go-mysql-server and is useful for testing the engine, or for using in tests for golang projects that want a fast, local MySQL database.

  • Dolt. In addition to the novel git-like storage engine, Dolt also adds a number of , , and new connection semantics.

Project architecture

go-mysql-server defines a number of interfaces to allow integrators to communicate about their database's capabilities, what tables exist, what the schemas of tables are, and so on. Then another set of interfaces let integrators iterate over their table rows, update them with new values, delete them, and so on. For more information, see .

Broadly, the system has three main components:

  1. The parser and server, which are mostly provided by . This component receives queries on the wire and parses them into an AST.

  2. The query analyzer, which repeatedly transforms the AST to determine an optimal execution strategy, doing things like applying indexes or ordering tables for a join.

  3. The execution engine, which iterates over table rows provided by integrators, evaluates expressions and functions, and produces the ultimate result set.

For much more technical details on how these pieces function, refer to the following blog articles:

go-mysql-server
go-mysql-server
system tables
custom functions
the project docs
Vitess
Indexed joins
Implementing subqueries
Pushing down filters to make queries faster
Planning joins to make use of indexes
Improvements in join planning
Implementing window functions
Common table expressions
Stored procedures
Triggers