sql

First layer: Client include connection handling, authentication, security to connect from client to server

Second layer: including the code for query parsing, analysis, optimization, and all the built-in functions. Any functionality provided across storage engines lives at this level: stored procedures, triggers, and views, for example

Third layer: contain storage engines. They are responsible for storing and retrieving all data stored “in” MySQL. The server communicates with them through the storage engine API. The storage engines don’t parse SQL(one exception is InnoDB, which does parse foreign key definitions) or communicate with one another; they simply respond to requests from the server.

Read/write lock

Systems that deal with concurrent read/write access implement a locking system that consists of two lock types call shared locks and exclusive locks, or read locks and write locks.