My SQLArchitecture
My SQLArchitecture
Architecture of MySQL
• Architecture of MYSQL describes the relation among the different components of MYSQL System.
• It is designed so that end user that is Clients can access the resources from Computer that is server using various
networking services.
• The Client give instructions to the Server with the help of Client Layer .
• The Client make request through Command Prompt or through GUI screen by using valid MYSQL commands and
expressions .
• If the Expressions and commands are valid then the output is obtained on the screen. Some important services of
client layer are :
• Connection Handling : When Client is connected to the server at that time , a client get it’s own thread for it’s
connection. With the help of this thread all the queries from client side is executed.
• Authentication : Authentication is performed on the server side when client is connected to the MySQL server.
Authentication is done with the help of username and password.
• Security : After authentication, when the client gets connected successfully to MySQL, the server will check that if
particular client has the privileges to issue certain queries against MySQL server.
Server Layer
• The second layer of MYSQL architecture is responsible for all logical functionalities of relational database
management system of MYSQL.
• Thread Handling : When a client send request to the server and server accept the request and then the client get
connected. After Client is connected to the server it get it’s own thread for it’s connection. This thread is provided by
thread handling of Server Layer. Queries of client side which are executed by this thread also handled by Thread
Handling module.
• Parser : A Parser is a type of Software Component that built a data structure(parse tree) for a given input . Before
parsing, lexical analysis is done i.e. input is broken into number of tokens . After the data is available in the smaller
elements parser perform Syntax Analysis , Semantics Analysis and after that parse tree is generated as output.
• Optimizer : As soon as the parsing is done ,various types of optimization techniques are applied at Optimizer
Block. These techniques may include rewriting the query, order of scanning of tables and choosing the right indexes
to use etc.
Server Layer (contd..)
• Query Cache : Query Cache stores the complete result set for inputted query statement. Even before Parsing,
MySQL Server looks into query cache. When client write a query , if the query is identical in the cache, then the
server simply skip the parsing, optimization and even execution and simply display the output from the cache.
• Buffer and Cache : Cache and buffer store the previous query. When User write a query it first goes to Query
Cache ,query cache will check that the same is available in the cache. If the same query is available then it will
provide output without interfering Parser, Optimizer.
• Table Metadata Cache : The metadata cache is a reserved area of memory used for tracking information on
databases, indexes, or objects. The greater the number of open databases, indexes, or objects, the larger the
metadata cache size.
• Key Cache : A key cache is an index entry that uniquely identifies an object in a cache.
Storage Layer (contd..)
• This Storage Engine Layer of MYSQL Architecture make it’s unique and most preferable for developer’s .
• Due to this Layer MYSQL layer is counted as the mostly used RDBMS and is widely used. In MYSQL server ,
• For Different situations and requirement’s different types of storage engines are used which are InnoDB ,MYiSAM ,
NDB ,Memory etc.