TL;DR MySQL
MySQL is the world's most widely used open source relational database management system. It organises data into tables made up of rows and columns and uses SQL, Structured Query Language, to create, read, update, and delete records. MySQL powers an enormous proportion of the web including WordPress, WooCommerce, and thousands of other popular applications, which is why understanding it is fundamental to web hosting. It is known for being fast, reliable, and well-supported with a huge ecosystem of tools, documentation, and community knowledge. CloudSonic offers fully managed MySQL with automated backups, replication, and performance tuning taken care of for you. If you need a MySQL-compatible database with additional features, MariaDB is also available as a fully managed option on CloudSonic.
How MySQL Works
MySQL operates as a client-server system. The MySQL server process runs continuously in the background, listening for connections from client applications. When WordPress needs to read or write data, it opens a connection to MySQL using credentials stored in the wp-config.php file, sends a SQL query, receives the result, and closes the connection or returns it to a connection pool. MySQL processes the query by first parsing it to check for syntax errors, then passing it to the query optimiser which generates an execution plan, then executing that plan against the data stored on disk and in memory. The InnoDB buffer pool, which CloudSonic sizes to approximately 30 percent of available RAM, caches frequently accessed data pages in memory so that repeated queries can be answered from RAM rather than requiring a disk read, significantly improving response times for busy sites.
# Create a new MySQL database and user with the CloudSonic helper
db-create mysite_db mysite_user
# Output:
# Database: mysite_db
# User: mysite_user
# Password: xK9mP2nQvR7wL4tY
# Host: 127.0.0.1
# Port: 3306
# DSN: mysql://mysite_user:xK9mP2nQvR7wL4tY@127.0.0.1:3306/mysite_db
# Create a new PostgreSQL database and user with the CloudSonic helper
pgdb-create mysite_db mysite_user
# Output:
# Database: mysite_db
# User: mysite_user
# Password: xK9mP2nQvR7wL4tY
# Host: 127.0.0.1
# Port: 5432
# DSN: postgresql://mysite_user:xK9mP2nQvR7wL4tY@127.0.0.1:5432/mysite_db