MySQL Architecture

[img]http://dev.mysql.com/doc/refman/5.1/en/images/PSEArch.png[/img]

MySQL Core Modules:
[b]Server Initialization Module[/b]
The Server Initialization Module is responsible for the server initialization on startup
sql/mysqld.cc
sql/sql_acl.cc
slq/slave.cc

[b]Connection Manager[/b]
The Connection Manager listens for incoming connections from clients, and dispatches the requests to the Thread Manager
sql/mysqld.cc

[b]Thread Manager[/b]
The Thread Manager is responsible for keeping track of threads and for making sure a thread is allocated to handle the connection from a client
sql/mysqld.cc
sql/sql_class.cc

[b]Connection Thread[/b]
The Connection Thread is the heart of the work of processing client requests on an established connection
sql/sql_parse.cc

[b]User Authentication Module[/b]
The User Authentication Module authenticates the connecting user and initializes the structures and variables containing the information on his level of privileges
sql/sql_parse.cc
sql/sql_acl.cc
sql/password.cc

[b]Access Control Module[/b]
The Access Control Module verifies that the client user has sufficient privileges to perform the requested operation
sql/sql_acl.cc
sql/sql_parse.cc

[b]Parser[/b]
The Parser is responsible for parsing queries and generating a parse tree
sql/sql_parse.cc
sql/sql_yacc.cc
sql/sql_lex.cc

[b]Command Dispatcher[/b]
The Command Dispatcher is responsible for directing requests to the lower-level modules that will know how to resolve them
sql/sql_parse.cc

[b]Query Cache Module[/b]
The Query Cache Module caches query results, and tries to short-circuit the execution of queries by delivering the cached result whenever possible
sql/sql_cache.cc

[b]Optimizer[/b]
The Optimizer is responsible for creating the best strategy to answer the query, and executing it to deliver the result to the client
sql/sql_select.cc

[b]Table Manager[/b]
The Table Manager is responsible for creating, reading, and modifying the table definition files (.frm extension), maintaining a cache of table descriptors called table cache, and managing table-level locks
sql/sql_base.cc
sql/table.cc
sql/unireg.cc
sql/lock.cc

[b]Table Modification Module[/b]
This collection of modules is responsible for operations such as creating, deleting, renaming, dropping, updating, or inserting into a table
sql/sql_update.ccc
sql/sql_insert.cc
sql/sql_table.cc
sql/sql_delete.cc

[b]Table Maintenance Module[/b]
The Table Maintenance Module is responsible for table maintenance operations such as check, repair, back up, restore, optimize (defragment), and analyze (update key distribution statistics)
sql/sql_table.cc

[b]Status Report Module[/b]
The Status Reporting Module is responsible for answering queries about server configuration settings, performance tracking variables, table structure information, replication progress, condition of the table cache, and other things
sql/sql_show.cc
sql/slave.cc
sql/sql_repl.cc

[b]Abstracted Storage Engine Interface(Table Handler)[/b]
This module is actually an abstract class named handler and a structure called a handlerton
sql/handler.h
sql/handler.cc

[b]Storage Engine Implementations(MyISAM, InnoDB, MEMORY, Berkeley DB)[/b]
Each of the storage engines provides a standard interface for its operations by extending the handler class mentioned earlier
sql/ha_myisam.h sql/ha_myisam.cc
sql/ha_innodb.h sql/ha_innodb.cc
sql/ha_heap.h sql/ha_heap.cc
sql/ha_ndbcluster.h sql/ha_ndbcluster.cc

[b]Logging Module[/b]
The Logging Module is responsible for maintaining higher-level (logical) logs
sql/log.cc
sql/log_event.cc

[b]Replication Master Module[/b]
The Replication Master Module is responsible for the replication functionality on the master
sql/sql_repl.cc

[b]Replication Slave Module[/b]
The Replication Slave Module is responsible for the replication functionality of the slave
sql/slave.cc

[b]Client/Server Protocol API[/b]
The MySQL client/server communication protocol sits on top of the operating system protocol (TCP/IP or local socket) in the protocol stack
sql/protocol.cc
sql/net_serv.cc

[b]Low-Level Network I/O API[/b]
The Low-Level Network I/O API provides an abstraction for the low-level network I/O and SSL sessions
vio/ direcotry

[b]Core API[/b]
The Core API is the Swiss Army knife of MySQL
It provides functionality for portable file I/O, memory management, string manipulation, filesystem navigation, formatted printing, a rich collection of data structures and algorithms, and a number of other things
mysys/ directory
strings/ directory

你可能感兴趣的:(Database,MySQL,SQL,SQL,Server,Cache,thread)