数据库技术栈 —— MySQL基础知识(一)

发布时间:2024年01月19日

一、MariaDB是什么?

Q:MySQL与MariaDB的区别是什么?
MariaDB是MySQL的一个分支,可以认为MariaDB是兼容MySQL的[1],为避免被Oracle裹挟和绑定,可以及时跳下Oracle的船,用MariaDB进行替代[2],MariaDB在数据文件格式的定义,及client protocols, client APIs, ports, and sockets上都是兼容MySQL的[3]

一、参考文章或视频资料
[1] 《mariadb与mysql的区别》- 百度知道
[2] The difference between choice and vendor lock-in
[3] What’s the Difference Between MariaDB and MySQL?

二、数据库存储引擎:MyISAM vs. InnoDB

Q1:MariaDB与InnoDB的区别又是什么?
首先,MariaDB是数据库,而InnoDB只是数据库存储引擎,二者不在一个层面上。
Q2:MyISAM与InnoDB二者的主要区别
Overall, MyISAM is an older and less efficient storage engine than InnoDB. The most commonly noted differences between these two engines are as follows: InnoDB is more stable, faster, and easier to set up; it also supports transactions. It is the default storage engine of choice for a reason, and you can use the features of InnoDB with no need to worry about compatibility issues. If you need to store large amounts of data or ensure that transactions will work correctly, choose InnoDB.
The MyISAM engine is not very good at storing large amounts of data, because it stores everything in a single table. When you need to add data to the database, you have to lock the entire table, which can cause your database to stop working until it is unlocked. In the InnoDB engine, each row is stored separately in a separate table. This means that when you insert data into a MySQL database, you do not need to lock all rows. [1]
总之,MyISAM整体上不如InnoDB,以后选MySQL的存储引擎选InnoDB就可以。

二、参考文章或视频资料
[1] InnoDB vs MyISAM: A Detailed Comparison of Two MySQL Storage Engines
[2] InnoDB Storage Engine - MariaDB

三、Mysql的架构

图1 —— MySQL官方架构图(参考链接3)

图2 —— MySQ架构图(参考链接2)

可以总结为以下四层架构

Client
Server
StorageEngine
StorageFiles
三、参考文章或视频资料
[1] Architecture of MySQL
[2] Architecture of MySQL
[3] 16.11 Overview of MySQL Storage Engine Architecture - MySQl

3.1 mysql与mysqld的区别

mysql 是MySQL的命令行工具,可以理解为图一里的MySQL Shell。
mysqld 全称是mysql daemon(守护进程daemon process的daemon),是Server端的程序

3.1 参考文章或视频资料
[1] 4.3.1 mysqld — The MySQL Server - MySQL
[2] It’s mysql or mysqld? - StackOverFlow
[3] Mysql vs mysqld vs mysql-server -Ask Ubuntu
文章来源:https://blog.csdn.net/weixin_44327736/article/details/135605754
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。