[Database] Mysql learning route

Table of contents

1. Mysql knowledge system

Two, mysql basics

3. Information

-course

- e-book

-Learning mysql website

- Read the official manual

-Daniu's blog

-project

4. Learning attitude: break the casserole and ask the end

-study

-interview


SQL, the full name of Structured Query Language, is a structured query statement . Its main function is to design, create and manage a relational database . The table of a relational database is a two-dimensional table similar to excel. It consists of rows and columns, and each column represents a field. In other words, SQL is a programming language for communicating with relational databases.

1. Mysql knowledge system

Base:

Tuning:

  • Index, slow query optimization
  • Configuration parameter tuning

Core principle:

  • InnoDb storage engine (including isolation level, transaction, lock, cache pool, rollback log, etc.)
  • Mysqld (including connection management, process management, query cache, query optimization, logging, etc.)

Architecture and O&M:

  • Users and permissions, security
  • backup and recovery
  • log
  • Distributed and highly available

Two, mysql basics

The first choice for getting started with a database is to learn how to build a basic environment, then choose a convenient graphical interface tool, learn various SQL statements, including basic DDL statements for building databases and tables, and then add, delete, modify and query statements, and after mastering the basic operations, you need to Learn to use some advanced features, such as views, stored procedures, cursors, custom functions, and more.

books:

"Mysql Must Know" "Database Concept System"

"High Performance MySQL (3rd Edition)", "MySQL Technology Insider (4th Edition)", " MySQL Technology Insider InnoDB Storage Engine ", "In-depth Understanding of MySQL" and Mysql's official website. After reading these things, plus some rich experience, theoretically speaking, you will have the level of DBA.

Aggregated blogs on Planet MySQL , especially Percona's MySQL & InnoDB performance and scalability blog .
 


3. Information

-course

Udacity's SQL course. The course link is here: SQL for Data Analysis

SQL for Data Analysis | Free Courses | Udacity

Strongly push the courses mentioned in it:

CMU Database Systems (15-445/645), thanks to Andy Pavlo
CMU Advanced Database Systems (15-721), thanks to Andy Pavlo
UC Berkeley Introduction to Database Systems
Stanford Database System Implementation
Let's Build a Simple Database, thanks to cstack

- e-book

I think it is good to read more books. Some books are worth reading many times over and over again. Sometimes, after reading them only once, they cannot be deeply understood and absorbed, and the thinking is not sufficient.

e-book download portal

-Learning mysql website

MySQL Tutorial - Learn MySQL Fast, Easy and Fun.

Learning MySQL is fast, easy and fun. Provides you with a complete MySQL tutorial in an easy-to-understand manner. Each tutorial has practical examples of SQL scripts and screenshots available.

mysql learning materials | mysql in-depth study notes in-depth notes

There are a lot of mysql information you can read, and you can also read the study notes made by netizens.

W3Schools SQL Tutorial

Can learn basic sql statements

- Read the official manual

No matter how good your English is, the ability to read English manuals is a must, and must be cultivated.

mysql official manual: 14 The InnoDB Storage Engine

-Daniu's blog

The blogs of domain experts are very valuable for learning. Here are a few good ones:

He Dengcheng's technical blog He Dengcheng 's technical blog

Taobao Dingqi Chasing Wind Knife·Dingqi-ITeye Technology Website

Zhou Zhenxing @淘宝花名: Su Pu A story @MySQL DBA

Peng Lixun, a senior expert of Alibaba Cloud database, is a formal member of MariaDB Foundation and is responsible for the review of related patches of the global Replication module. Peng Lixun also became the first Chinese programmer introduced by the MariaDB Foundation. P.Linux Laboratory

Planet MySQL

Last but not least, use more.

-project

GitHub - pingcap/awesome-database-learning: A list of learning materials to understand databases internals

Seven open source projects, so that your database management is no longer a problem - Zhihu (zhihu.com) 

Author: Gong Zijie
Link: https://www.zhihu.com/question/34840297/answer/272185020
Source: Zhihu
The copyright belongs to the author. For commercial reprint, please contact the author for authorization, for non-commercial reprint, please indicate the source.


4. Learning attitude: break the casserole and ask the end

-study

But, as I said at the beginning. When facing problems, you must think positively!

for example:

Let me ask you, in the face of a scenario with a relatively high concurrency, how to configure the number of mysql connections?

You may answer: "Oh, just increase the value of max_connection ."

So, have you ever thought about how much is the most appropriate? Why is this setting the most appropriate?

Maybe you will answer: "Well, I know, you can look at the value of max_used_connection before the system , and then set it. You can also increase the value of back_log."

Have you ever thought about the bad effects of too high max_connection connections? What's wrong with setting back_log too high? The upper limit of max_connect actually depends on the number of file descriptors that mysql can obtain . That is to say, even if you set it to 10000, it will be useless in the end, and the system will automatically lower it according to the situation of the machine.

Maybe you will answer: "Well, I know, if the setting is too high, there will be system overhead..."

Have you ever thought about what exactly these expenses are? What job is causing this memory overhead?

You may also answer that when a connection is created, it will immediately allocate a connection buffer and a query buffer, which will eat up memory.

Have you ever thought about how many resources are occupied? Depends on what factors?

Ok, let's end this question first. Going back to the question of Zhihu, in fact, I have said so much, just to express how to learn mysql by myself.

So, you have to keep thinking, so that when you face a specific scene at work, you can calmly deduce: "Oh, there must be something wrong here. What should I do?"

Faced with the problem, show the spirit of breaking the casserole and asking the end, think about it first, give your own hypothesis, and don't rush to find Du Niang, Google. After thinking about it, take your inference or answer and go searching boldly! Go and see other people's opinions, go and see the official description!

This is the attitude an engineer should have.

-interview

We build rockets in the interview and screw the screws at work. Although we all use basic SQL at work, I’m sorry, 90% of the interviews are about principles, such as indexes, locks, logs, and engines. In order to let everyone have a The point, I think if you master the following knowledge, the mysql interview will definitely become your bonus item:

1. How is a sql statement executed? That is to say, if a sql command is executed from the client, what processing will the server perform? (such as verifying identity, whether to enable caching or not).

2. Index related: How is the index implemented? What are the implementation differences of multiple engines? Clustered index , non-clustered index, secondary index, unique index, leftmost matching principle , etc. (very important).

3. Transaction related: For example, how is transaction isolation achieved? How does the transaction guarantee atomicity? Why are the data seen by different transactions different? Does every transaction copy a view? The realization principle of MVCC (important) and so on.

4. Various locks: such as table locks, row locks, gap locks , shared locks, and exclusive locks. What problems are these locks mainly used to solve? (important)

5. Log related: redolog, binlog, undolog , the realization principle of these logs, how to solve the problem? The log is also very important, and there are a lot of questions in the interview.

6. Master-slave backup of the database, how to ensure that data is not lost, how to ensure high availability, etc.

7. Some troubleshooting commands, such as slow query , sql execution plan, refresh of index statistics, etc.

For the four related knowledge of 2-4, the frequency of being asked in the interview is the highest. Sometimes the interview will ask you to talk about the index. If you know a lot, you can talk wildly. I remember I summarized it A set of ridiculous templates:

Let me first talk about why the index is fast from the perspective of the B tree-"Take the opportunity to talk about other implementation methods of the index->Different engines have different index implementations-"The system judges whether to use the index->Obviously added the index but Do not take the index?

Only if you understand all kinds of data structures and indexing principles , you can talk about it, and it is the same for things and locks. At that time, the interviewer asked me how to ensure the consistency of transactions. I happened to have studied redolog, binlog, and undolog. The log, and then chatted with the interviewer for a long time.

Well, having said so much, in fact, I just want to say that you must know the reason for the above knowledge, but mysql does not need to learn a lot like algorithms, so in terms of learning sequence, there is nothing to introduce, according to the book Learn in order. Next, I will mainly recommend a book I have read and an awesome column. If you learn both of these, you can basically answer fluently during the interview.

reference:

 Why is the database course so difficult to learn, and how should I learn it? - Zhihu (zhihu.com)

How to learn MySQL database by yourself with zero foundation? - Zhihu (zhihu.com)

Niuke Online Programming_Programming Learning|Practice_Data Structure|System Design Question Bank (nowcoder.com)

mysql learning materials download - deep notes (notedeep.com)

Guess you like

Origin blog.csdn.net/icecreamTong/article/details/129384341