Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the functions of MariaDB architecture

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "what are the functions of MariaDB architecture", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the functions of MariaDB architecture"?

MariaDB Server is one of the most popular open source relational databases. It was created by the original developers of MySQL and guaranteed to remain open source. It is part of most cloud products and is the default configuration for most Linux distributions. MariaDB is designed as a direct alternative to MySQL, with more features, a new storage engine, fewer errors and better performance.

Database and relational database

Database (Database) is a warehouse that organizes, stores and manages data according to the data structure, while mysql, oracle and mariadb are all database management software (DBMS), which are used to manage the database.

Relational database

A relational database is a collection of data, which is stored in the corresponding data table, and "relationship" refers to the association between the tables. Each row of the table represents a record, and each column represents a field, or the attribute of the data. This kind of storage is also most suitable for our real life. For example, the table shown below has been seen frequently since we went to school.

SQL language

Structured query language (Structured Query Language), referred to as SQL, is a special purpose programming language. It is a database query and programming language, which is used to access data and query, update and manage relational database systems. It is also an extension of database script files.

Structured query language mainly consists of three parts: first, data query language (DQL:Data Query Language): also known as "data retrieval statement", which is used to obtain data from tables and determine how the data is given in the application. Keywords: SELECT, WHERE, ORDER BY, GROUP BY, HAVING II: data manipulation language (DML:Data Manipulation Language): mainly used to add, modify and delete rows in the table. Keywords: INSERT, UPDATE, DELETE III: data definition language (DDL): mainly used to create new tables in the database or delete tables (CREAT TABLE or DROP TABLE), add indexes for tables, etc. Keywords: CREATE, DROP

Brief introduction

MariaDB database management system is a branch of MySQL and is mainly maintained by the open source community. The purpose of licensing MariaDB with GPL is to be fully compatible with MySQL, including API and the command line, making it an easy replacement for MySQL. In terms of storage engine, use XtraDB instead of MySQL's InnoDB. The above content is copied from Baidu Encyclopedia. At the time of writing, mariadb10.3 has been switched to Innodb as the default storage engine. In fact, XtraDB and InnoDB are the same thing and can be regarded as the community version of InnoDB.

Mariadb logical architecture

When Mariadb receives the Sql statement, its detailed execution process is as follows: 1 when the client connects to mariadb, it will authenticate the client's hostname, user, password, authentication function can be made into a plug-in. 2 if the login is successful, the client sends a sql command to the server 3 and the parser parses the sql statement 4 the server checks whether the client has permission to obtain the resources it wants 5 if the query is already stored in query cache, then the result is immediately returned 6 the optimizer will find the fastest execution strategy or execution plan, that is, the optimizer can decide which tables will be read and which indexes will be accessed Which temporary tables will be used, a good strategy can reduce a lot of disk access and sorting operations, etc. 7 Storage engine reads and writes data and index files, cache is used to speed up these operations, and other features such as things and foreign keys are handled at the storage engine layer.

Example

MySQL (Mariadb) is single-process multithreading, that is to say, each Mysql instance is a service process on the system, and an instance can have different configuration files, ports, manage different databases, etc. Mariadb instance is actually a mysqld file, which can be run directly on Linux, but it is usually called by mysqld_safe script, which can not only start the instance, but also restart the instance of unexpected terminal. It is safer than mysqld in a production environment.

Storage engine

The storage engine controls data at the physical layer, and it is responsible for the management of data files, data, indexes, cache, etc., which makes it more efficient to manage and read data. Every table has a .frm file that contains the definition of the table. Use the "show engines" command or query the information_schema.engines table to view the storage engine-related variables, as shown in the following figure:

Each storage engine manages and stores data in different ways, and supports different features and performances, such as MyISAM, which is suitable for reading more and writing less, and does not support transactions, supports InoDB such as full-text index, supports transactions, supports MEMORY such as row locks and foreign keys, stores data in memory CSV, stores data in CSV format, and so on. Therefore, it is particularly important to choose an appropriate data engine.

Check what the current default storage engine is: SELECT @ @ global.storage_engine

Mysql command line skills to solve the problem of too long output

\ G the use of identifiers, outputting each row of records as one page, as shown below:

\ P the identifier is set to pager. The commonly used pager includes less, more, grep, md5sum and so on. To put it bluntly, it is to use pipes to output standard output (STO) to Pager.

At this point, I believe you have a deeper understanding of "what are the functions of the MariaDB architecture?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report