Mysql Architecture

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

MySQL

Architecture

1
2 December 5, 2019

Introduction
MySQL is an open-source relational database
management system. Its name is a combination of
"My", the name of co-founder Michael Widenius's
daughter, and "SQL", the abbreviation for Structured
Query Language.
 Based on client/server architecture
 MySQL was originally created to incorporate indexing
data to speed up data queries in the mSQL
database server, by using the indexed sequential
access method (ISAM). It did this by incorporating a
special data management algorithm called the
MyISAM storage engine. This proved to be a huge
success.
3 December 5, 2019

Overview
4 December 5, 2019

The brain of the MySQL server


Component Feature
Parser Responsible for deconstructing the
requested SQL statements

Optimizer Responsible for finding the optimal


execution plan for the query
Executing Responsible for executing the
optimized path for the SQL command
passed through the parser and
optimizer
Query Cache The query cache is a fast in-memory
store to quickly look up the result set
of a particular SELECT statement
Storage Engines Enables MySQL to use different
implementations for storing, retrieving
and indexing data
5 December 5, 2019

MySQL (InnoDB)Architecture
6 December 5, 2019

The InnoDB Storage Engine


 Fully transactional ACID.
 Offers REDO and UNDO for transactions.
 Data storage in tablespace:
– Multiple data files
– Logical object structure using InnoDB data
and log buffer.
 Row-level locking.
7 December 5, 2019

InnoDB In-Memory Structures


 Buffer Pool
 Change Buffer
The change buffer is a special data structure
that caches changes to secondary index pages
when those pages are not in the buffer pool.
 Adaptive Hash Index
This feature enables InnoDB to perform more like
an in-memory database
 Log Buffer
8 December 5, 2019

InnoDB On-Disk Structures

 Tables/Indexes
 Tablespaces
 InnoDB Data Dictionary
 Doublewrite Buffer
It a storage area located in the system
tablespace where InnoDB writes pages that are
flushed from the InnoDB buffer pool, before the
pages are written to their proper positions in the
data file.
 Redo Log
 Undo Logs
9 December 5, 2019

The MyISAM Storage Engine

The MyISAM storage engine was the default


storage engine from MySQL 3.23 until it was
replaced by InnoDB in MariaDB and MySQL
5.5.
 Non-transactional storage engine
 Speed for read
 Data storage in files and use key,
metadata and query cache
 Table-level locking.
10 December 5, 2019

Choosing Appropriate Storage


Engines
 Ask yourself what type of queries will be
used
 Choose engine with locking level needed
for expected workload
 MyISAM:For many reads, few writes
 InnoDB: Mixed reads/writes, many users
and concurrency

You might also like