Databases interview

1, nosql you know it? What are you using nosql?

nosql: non-relational databases such as Redis, Memcache, MongoDb

2, mysql Index Tuning

Optimization of the primary key, unique indexes, foreign keys optimized column index, the prefix indexes, full-text indexes, spatial indexes, multi-column index

3, optimization of mysql

https://blog.csdn.net/liuyanqiangpk/article/details/79827239

https://blog.csdn.net/u013628152/article/details/82184809

4. What is a transaction? Its characteristics?

Services: is a series of database operations, is the basic logical unit of database applications.

characteristic:

(1) Atomic: that is indivisible, the entire transaction is either performed or not performed on all.

(2) or string of consistency. Executing the transaction database so that the correct conversion from one state to another state correctly

(3) isolation. Before the transaction correctly submitted, does not allow any changes to the transaction data available to any other matters,

(4) persistence. After the transaction the right to submit the results will be permanently stored in the database, even with the other failures in the transaction is committed, the result of processing the transaction will be saved.

Simple to understand: operations in a transaction where, either all succeed, or all fail.
 

5, the primary database copy is separated from the read and write

Copy of the master-slave principle
separate MySQL master-slave replication and both reading and writing are closely linked, we must first deploy a master-slave replication, only the master-slave replication to complete a separate read and write data on this basis.

The principle of separate read and write
simple terms, is to separate read and write only on the primary server to write, read-only from the server. The basic principle is to let the Lord handle transactional database queries, and select from the server to process queries. Database replication is used to query transactional changes resulting from synchronized to the database.

Agent generally located between the client and the server, the proxy server receives the client request is forwarded to the rear end section of the database is determined by: Based on the intermediate layer agent.

https://www.cnblogs.com/codehome/p/9356496.html

https://blog.51cto.com/13555423/2068071

6, message queues how

Asynchronous, decoupled, clipping.

  1. Asynchronous. A system needs to send a request to the B-block processing, due to the B system needs to update the database query takes a long time to wait for that A system B system before sending the next request is processed, resulting in a waste of resources A system using Message the queue, A production system after the completion message directly thrown message queue, a request is complete, continue to the next request.
  2. Decoupling. A system to send data to BCD three systems, interface call is sent, that if E systems have this information? If the C system that now do not need it? A second system now have to send data out? A system is responsible for people on the verge of collapse. . . Some more crashes more thing, A system should always consider if the system hung up BCDE four supposed to? I do not want to resend? Shall I save up the message? Message Queuing can solve this problem, A system is only responsible for production data, the message is no need to consider which system to the consumer.
  3. Clipping. A data processing system the system call B, 0:00 to 11:00 every day, A calm system, the number of concurrent requests per second to 100. The results of each 1 to 11 o'clock to 1:00, the number of concurrent requests per second suddenly surge to 10,000. However, the maximum processing capacity of the B-system can only process 1000 requests per second is ah. . . Embarrassing, the system will collapse out. . . Introducing the message queue, requesting the data stored in the first message broker system, the system slowly pull consumer consumption.

7, the query optimizer

Reference: https://blog.csdn.net/weixin_38477351/article/details/89786763 , L /.

https://www.jianshu.com/p/127d27cc0e88

8, msyql storage engine, as well as their differences

https://blog.csdn.net/Java_fenxiang/article/details/82870335

9, redis and memcache What is the difference

https://blog.csdn.net/klfsk/article/details/100130046

10, an index which, how do you index?

https://www.cnblogs.com/xiaowenboke/p/10430670.html

11, how to divide the table

https://blog.csdn.net/hu_feng903/article/details/84930136

Published 72 original articles · won praise 7 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_39399966/article/details/104397620