SlideShare a Scribd company logo
1 of 47
Download to read offline
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
MySQL	
  For	
  Linux	
  
Sysadmins
Morgan	
  Tocker	
  
MySQL	
  Community	
  Manager	
  
August,	
  2014
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Safe	
  Harbor	
  Statement
The	
  following	
  is	
  intended	
  to	
  outline	
  our	
  general	
  product	
  direction.	
  
It	
  is	
  intended	
  for	
  information	
  purposes	
  only,	
  and	
  may	
  not	
  be	
  
incorporated	
  into	
  any	
  contract.	
  It	
  is	
  not	
  a	
  commitment	
  to	
  deliver	
  
any	
  material,	
  code,	
  or	
  functionality,	
  and	
  should	
  not	
  be	
  relied	
  upon	
  
in	
  making	
  purchasing	
  decisions.	
  The	
  development,	
  release,	
  and	
  
timing	
  of	
  any	
  features	
  or	
  functionality	
  described	
  for	
  Oracle’s	
  
products	
  remains	
  at	
  the	
  sole	
  discretion	
  of	
  Oracle.
Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
3
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
4
Program	
  Agenda
Introduction	
  
MySQL	
  Architecture	
  
Backup	
  &	
  Replication	
  
Performance	
  &	
  Capacity	
  Planning
1
2
3
4
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
The	
  Career	
  Path	
  to	
  DBA
• Start	
  as	
  a	
  Developer	
  
• Start	
  as	
  a	
  Sysadmin	
  
• Train	
  to	
  be	
  a	
  DBA
5
Usually either #1 or #2.
I started as a Developer
}
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Non	
  Exhaustive	
  List	
  of	
  Duties
• Backup	
  
• Replication	
  
• Patching	
  &	
  Upgrades	
  
• Performance	
  and	
  Capacity	
  Planning	
  
• Coaching	
  &	
  Mentoring	
  
• Fighting	
  Fires
6
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
7
Program	
  Agenda
Introduction	
  
MySQL	
  Architecture	
  
Backup	
  &	
  Replication	
  
Performance	
  &	
  Capacity	
  Planning
1
2
3
4
2
1
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
About	
  MySQL
• Version	
  numbers	
  are	
  misleading:	
  
• 5.5	
  to	
  5.6	
  was	
  the	
  biggest	
  upgrade	
  in	
  history	
  
• 5.6.xx	
  
• Micro-­‐release	
  approximately	
  every	
  2	
  months.	
  
• Fixes	
  bugs	
  and	
  security	
  vulnerabilities.
8
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
About	
  MySQL	
  (cont.)
• 5.7.xx	
  
• Current	
  focus	
  of	
  development.	
  
• Release	
  cycle	
  is	
  2-­‐3	
  years.	
  
• 5.5	
  and	
  5.6	
  are	
  under	
  active	
  support.
9
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
10
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Storage	
  Engines	
  in	
  MySQL
• InnoDB	
  (default)	
  
• MyISAM	
  (previous	
  default)	
  
• NDB	
  Cluster	
  
• Other
11
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Memory	
  Usage
• Databases	
  like	
  to	
  allocate	
  large	
  amounts	
  of	
  memory	
  
for	
  caches	
  
• Better	
  to	
  run	
  with	
  smaller	
  caches	
  than	
  swap	
  
• Kind	
  of	
  works	
  as	
  “double	
  buffering”	
  of	
  operating	
  
system	
  caches
12
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
MySQL	
  Server
• Single	
  process	
  of	
  mysqld	
  
• Supervisor	
  process	
  is	
  mysqld_safe	
  
• Each	
  new	
  MySQL	
  connection	
  consumes	
  a	
  thread	
  
• With	
  the	
  server	
  maintaining	
  a	
  small	
  thread	
  cache
13
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
14
Transaction
System
StorageCaching
SYS_TABLES
ibdata1
space0
Page Cache
A.ibd
B.ibd
C.ibd
IBUF_HEADER
IBUF_TREE
TRX_SYS
FIRST_RSEG
DICT_HDR
Data Dict.
SYS_COLUMNS
SYS_INDEXES
SYS_FIELDS
Block 1 (64 pages)
Block 2 (64 pages)
iblogfile0 iblogfile1 iblogfile2
Tables with
file_per_tableDoublewrite Buffer
BufferPool
Data Dictionary Cache
Adaptive Hash Indexes
Buffer Pool LRU
Additional Mem Pool
Log Buffer
LogGroup
Buffer Pool Flush List
In Memory
On Diskhttps://github.com/jeremycole/innodb_diagrams
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
15
InnoDBTransaction
System
StorageCaching
SYS_TABLES
ibdata1
space0
Page Cache
A.ibd
B.ibd
C.ibd
IBUF_HEADER
IBUF_TREE
TRX_SYS
FIRST_RSEG
DICT_HDR
Data Dict.
SYS_COLUMNS
SYS_INDEXES
SYS_FIELDS
Block 1 (64 pages)
Block 2 (64 pages)
iblogfile0 iblogfile1 iblogfile2
Tables with
file_per_tableDoublewrite Buffer
BufferPool Data Dictionary Cache
Adaptive Hash Indexes
Buffer Pool LRU
Additional Mem Pool
Log Buffer LogGroup
Buffer Pool Flush List
SELECT * FROM a
WHERE id = 10;
mysqld
Not Found
Query	
  -­‐	
  Non	
  Cached
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
16
InnoDBTransaction
System
StorageCaching
SYS_TABLES
ibdata1
space0
Page Cache
A.ibd
B.ibd
C.ibd
IBUF_HEADER
IBUF_TREE
TRX_SYS
FIRST_RSEG
DICT_HDR
Data Dict.
SYS_COLUMNS
SYS_INDEXES
SYS_FIELDS
Block 1 (64 pages)
Block 2 (64 pages)
iblogfile0 iblogfile1 iblogfile2
Tables with
file_per_tableDoublewrite Buffer
BufferPool Data Dictionary Cache
Adaptive Hash Indexes
Buffer Pool LRU
Additional Mem Pool
Log Buffer LogGroup
Buffer Pool Flush List
SELECT * FROM a
WHERE id = 10;
mysqld
Query	
  -­‐	
  Cached
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
17
Update	
  Query	
  in	
  a	
  	
  
Transaction	
  (simplified)
InnoDB
Transaction
System
StorageCaching
SYS_TABLES
ibdata1
space0
Page Cache
A.ibd
B.ibd
C.ibd
IBUF_HEADER
IBUF_TREE
TRX_SYS
FIRST_RSEG
DICT_HDR
Data Dict.
SYS_COLUMNS
SYS_INDEXES
SYS_FIELDS
Block 1 (64 pages)
Block 2 (64 pages)
iblogfile0 iblogfile1 iblogfile2
Tables with
file_per_tableDoublewrite Buffer
BufferPool
Data Dictionary Cache
Adaptive Hash Indexes
Buffer Pool LRU
Additional Mem Pool
Log Buffer
LogGroup
Buffer Pool Flush List
UPDATE a SET col1 =
‘new’ WHERE id = 10;
mysqld
commit;
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Log	
  Files
• Provide	
  recovery.	
  
• Only	
  written	
  to	
  in	
  regular	
  operation.	
  
• Read	
  only	
  required	
  if	
  there	
  is	
  a	
  crash.	
  
• Are	
  rewritten	
  over-­‐and-­‐over	
  again.	
  
• Think	
  of	
  it	
  like	
  a	
  tank	
  tread.
18
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
19
Program	
  Agenda
Introduction	
  
MySQL	
  Architecture	
  
Backup	
  &	
  Replication	
  
Performance	
  &	
  Capacity	
  Planning
1
2
3
4
1
3
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Backup	
  (Theory)
• Cold	
  
• Warm	
  
• Hot
20
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Backup	
  Consistency
• Must	
  represent	
  a	
  single	
  point	
  in	
  time
21
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | 22
customerid name
1 Acorn Enterprises
2 First National Squirrel Bank
3 Squirrels 5000 Inc
invoiceid customerid ...
1 1 # Acorn Enterprises
2 1 # Acorn Enterprises
3 3 # Squirrels 5000 Inc
customer
invoice
itemid invoiceid Description Amount
1 1 1 hrs Professional
Services
$10
2 2 Acorn Parts $12.50
3 2 5 hrs Professional
Services
$50
4 3 Delivery Fee $17.50
5 3 Replacement
Acorn
$20
invoice_item
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | 23
customerid name
1 Acorn Enterprises
2 First National Squirrel Bank
3 Squirrels 5000 Inc
invoiceid customerid ...
1 1 # Acorn Enterprises
2 1 # Acorn Enterprises
3 3 # Squirrels 5000 Inc
customer
invoice
itemid invoiceid Description Amount
1 1 1 hrs Professional
Services
$10
2 2 Acorn Parts $12.50
3 2 5 hrs Professional
Services
$50
4 3 Delivery Fee $17.50
5 3 Replacement
Acorn
$20
invoice_item
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | 24
customerid name
1 Acorn Enterprises
2 First National Squirrel Bank
3 Squirrels 5000 Inc
invoiceid customerid ...
1 1 # Acorn Enterprises
2 1 # Acorn Enterprises
3 3 # Squirrels 5000 Inc
customer
invoice
itemid invoiceid Description Amount
1 1 1 hrs Professional
Services
$10
2 2 Acorn Parts $12.50
3 2 5 hrs Professional
Services
$50
4 3 Delivery Fee $17.50
5 3 Replacement
Acorn
$20
invoice_item
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | 25
customerid name
1 Acorn Enterprises
2 First National Squirrel Bank
3 Squirrels 5000 Inc
4 Savvy Squirrel Global
invoiceid customerid ...
1 1 # Acorn Enterprises
2 1 # Acorn Enterprises
3 3 # Squirrels 5000 Inc
4 4 # Savvy Squirrels
customer
invoice
itemid invoiceid Description Amount
1 1 1 hrs Professional
Services
$10
2 2 Acorn Parts $12.50
3 2 5 hrs Professional
Services
$50
4 3 Delivery Fee $17.50
5 3 Replacement
Acorn
$20
6 4 Premium Acorn $999
invoice_item
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | 26
customerid name
1 Acorn Enterprises
2 First National Squirrel Bank
3 Squirrels 5000 Inc
4 Savvy Squirrel Global
invoiceid customerid ...
1 1 # Acorn Enterprises
2 1 # Acorn Enterprises
3 3 # Squirrels 5000 Inc
4 4 # Savvy Squirrels
customer
invoice
itemid invoiceid Description Amount
1 1 1 hrs Professional
Services
$10
2 2 Acorn Parts $12.50
3 2 5 hrs Professional
Services
$50
4 3 Delivery Fee $17.50
5 3 Replacement
Acorn
$20
6 4 Premium Acorn $999
invoice_item
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | 27
customerid name
1 Acorn Enterprises
2 First National Squirrel Bank
3 Squirrels 5000 Inc
4 Savvy Squirrel Global
invoiceid customerid ...
1 1 # Acorn Enterprises
2 1 # Acorn Enterprises
3 3 # Squirrels 5000 Inc
4 4 # Savvy Squirrels
customer
invoice
itemid invoiceid Description Amount
1 1 1 hrs Professional
Services
$10
2 2 Acorn Parts $12.50
3 2 5 hrs Professional
Services
$50
4 3 Delivery Fee $17.50
5 3 Replacement
Acorn
$20
6 4 Premium Acorn $999
invoice_item
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | 28
customerid name
1 Acorn Enterprises
2 First National Squirrel Bank
3 Squirrels 5000 Inc
4 Savvy Squirrel Global
invoiceid customerid ...
1 1 # Acorn Enterprises
2 1 # Acorn Enterprises
3 3 # Squirrels 5000 Inc
4 4 # Savvy Squirrels
customer
invoice
itemid invoiceid Description Amount
1 1 1 hrs Professional
Services
$10
2 2 Acorn Parts $12.50
3 2 5 hrs Professional
Services
$50
4 3 Delivery Fee $17.50
5 3 Replacement
Acorn
$20
6 4 Premium Acorn $999
invoice_item
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Backup	
  Methods
• mysqldump	
  
• Is	
  warm	
  by	
  default.	
  	
  Can	
  safely	
  be	
  set	
  hot	
  if	
  all	
  InnoDB.	
  
• Logical	
  backup.	
  	
  Slow	
  to	
  recover.	
  
• Snapshot	
  Based	
  -­‐	
  i.e.	
  LVM	
  snapshot.	
  
• Consistent	
  +	
  Hot	
  
• May	
  have	
  higher	
  impact	
  during	
  snapshot	
  phase.	
  
• Best	
  used	
  with	
  a	
  script	
  like	
  mylvmbackup.
29
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Backup	
  Methods	
  (cont.)
• MySQL	
  Enterprise	
  Backup	
  
• Commercial	
  Tool	
  
• Hot	
  with	
  InnoDB.	
  	
  Warm	
  for	
  MyISAM	
  phase	
  
• Low	
  Impact
30
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
How	
  to	
  Decide?
• MTTR	
  of	
  logical	
  backups	
  is	
  much	
  higher.	
  
• Most	
  failures	
  are	
  accidents	
  (either	
  by	
  DBA	
  or	
  user).	
  
• “I	
  accidentally	
  updated	
  the	
  phone	
  number	
  of	
  the	
  
wrong	
  customer!”
31
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Replication
• Built	
  in	
  to	
  MySQL	
  
• Easy	
  to	
  setup	
  and	
  get	
  running	
  
• Uses	
  same	
  port	
  3306	
  
• Most	
  deployments	
  will	
  use	
  Replication
32
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Replication	
  Options
• Row	
  Format	
  
• Statement	
  Based	
  (default)	
  
• Row	
  Based	
  
• Global	
  Transaction	
  IDs	
  
• Semi-­‐Synchronous	
  
• Time	
  delayed
33
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
34
Program	
  Agenda
Introduction	
  
MySQL	
  Architecture	
  
Backup	
  &	
  Replication	
  
Performance	
  &	
  Capacity	
  Planning
1
2
3
4
1
4
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Quality	
  of	
  Service
• Often	
  better	
  to	
  let	
  one	
  too	
  demanding	
  user	
  go	
  
unserviced	
  than	
  all	
  users	
  go	
  unserviced	
  
• Statement	
  Timeout	
  coming	
  to	
  MySQL	
  5.7.
35
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Quality	
  of	
  Service	
  (cont.)
• Replication	
  Slaves,	
  Hadoop	
  very	
  useful.	
  
• Important	
  to	
  Optimize	
  for	
  Response	
  Time	
  (user	
  facing)	
  
before	
  sub	
  optimizing	
  for	
  background	
  tasks.
36
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Configuration
Most	
  important	
  settings
• innodb_buffer_pool_size	
  -­‐	
  50-­‐80%	
  of	
  memory	
  
• innodb_log_file_size	
  -­‐	
  up	
  to	
  4G	
  quite	
  safe
37
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Configuration
Also	
  Useful
• innodb_flush_method	
  
• innodb_flush_neighbors	
  
• innodb_io_capacity	
  and	
  innodb_lru_scan_depth	
  
• Explained	
  here:	
  
• http://www.tocker.ca/2013/09/17/what-­‐to-­‐tune-­‐in-­‐
mysql-­‐56-­‐after-­‐installation.html
38
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
How	
  much	
  can	
  you	
  expect	
  from	
  config?
Versus	
  other	
  optimizations
• Optimizing	
  Queries	
  is	
  critical	
  to	
  performance	
  
• SQL	
  is	
  hard	
  
• Easy	
  to	
  write	
  
• Hard	
  to	
  sight	
  check	
  for	
  performance
39
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
How	
  to	
  find	
  slow	
  queries?
• Pro-­‐active:	
  
• Design	
  or	
  review	
  all	
  schema	
  and	
  queries.	
  
• Re-­‐active:	
  
• Find	
  worst	
  offenders	
  and	
  suggest	
  improvements	
  to	
  
development	
  staff.
40
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Realistic	
  Compromise
• Query	
  and	
  index	
  usage	
  changes	
  over	
  time	
  
• You	
  have	
  to	
  have	
  tools	
  in	
  place	
  to	
  find	
  slow	
  SQL	
  
• We	
  release	
  MySQL	
  Enterprise	
  Monitor	
  for	
  this	
  purpose
41
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Hardware	
  Choices
• Frequently	
  memory	
  is	
  under-­‐provisioned	
  
• http://rhaas.blogspot.ca/2014/08/memory-­‐
matters.html	
  (PostgreSQL)	
  
• http://www.tocker.ca/2013/05/10/twice-­‐as-­‐much-­‐
ram-­‐does-­‐not-­‐equal-­‐twice-­‐as-­‐fast.html	
  (Me;	
  MySQL)
42
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Hardware	
  Choices	
  (cont.)
• SSD	
  transition	
  is	
  real	
  
• But	
  still	
  better	
  to	
  buy	
  more	
  memory	
  first	
  
• Database	
  need	
  to	
  write	
  for	
  persistence.	
  	
  Heavier	
  IO	
  
requirements	
  than	
  any	
  other	
  tier
43
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
Hardware	
  Choices	
  (cont.)
• More	
  CPUs	
  can	
  mean	
  more	
  consistent	
  performance	
  
• Some	
  level	
  of	
  scale	
  up	
  +	
  scale	
  out	
  is	
  best:	
  
• http://www.tocker.ca/2014/04/22/five-­‐reasons-­‐why-­‐
vertical-­‐scalability-­‐matters.html	
  
44
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  |
Non	
  Exhaustive	
  List	
  of	
  Duties
• Backup	
  
• Replication	
  
• Patching	
  &	
  Upgrades	
  
• Performance	
  and	
  Capacity	
  Planning	
  
• Coaching	
  &	
  Mentoring	
  
• Fighting	
  Fires
45
Copyright	
  ©	
  2014	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  	
  | Oracle	
  Confidential	
  –	
  Internal/Restricted/Highly	
  Restricted
46
MySQL For Linux Sysadmins

More Related Content

What's hot

MySQL 5.7: Core Server Changes
MySQL 5.7: Core Server ChangesMySQL 5.7: Core Server Changes
MySQL 5.7: Core Server ChangesMorgan Tocker
 
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...Dave Stokes
 
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMorgan Tocker
 
InnoDB Tablespace Encryption
InnoDB Tablespace Encryption InnoDB Tablespace Encryption
InnoDB Tablespace Encryption Satya Bodapati
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance TuningMark Swarbrick
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMario Beck
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise PortfolioAbel Flórez
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014Dave Stokes
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksDave Stokes
 
Locking and Concurrency Control
Locking and Concurrency ControlLocking and Concurrency Control
Locking and Concurrency ControlMorgan Tocker
 
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricksQuery Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricksJaime Crespo
 
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Dave Stokes
 
MySQL partitioning
MySQL partitioning MySQL partitioning
MySQL partitioning OracleMySQL
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1Ivan Ma
 
MySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats newMySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats newMark Swarbrick
 
MySQL 5.7 Replication News
MySQL 5.7 Replication News MySQL 5.7 Replication News
MySQL 5.7 Replication News Ted Wennmark
 
Understanding MySql locking issues
Understanding MySql locking issuesUnderstanding MySql locking issues
Understanding MySql locking issuesOm Vikram Thapa
 
Barcelona mysqlnd qc
Barcelona mysqlnd qcBarcelona mysqlnd qc
Barcelona mysqlnd qcAnis Berejeb
 

What's hot (20)

MySQL 5.7: Core Server Changes
MySQL 5.7: Core Server ChangesMySQL 5.7: Core Server Changes
MySQL 5.7: Core Server Changes
 
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
 
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
 
InnoDB Tablespace Encryption
InnoDB Tablespace Encryption InnoDB Tablespace Encryption
InnoDB Tablespace Encryption
 
My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance Tuning
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
 
Optimizing MySQL
Optimizing MySQLOptimizing MySQL
Optimizing MySQL
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise Portfolio
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disks
 
Locking and Concurrency Control
Locking and Concurrency ControlLocking and Concurrency Control
Locking and Concurrency Control
 
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricksQuery Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
 
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
 
MySQL partitioning
MySQL partitioning MySQL partitioning
MySQL partitioning
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
 
MySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats newMySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats new
 
MySQL 5.7 Replication News
MySQL 5.7 Replication News MySQL 5.7 Replication News
MySQL 5.7 Replication News
 
Understanding MySql locking issues
Understanding MySql locking issuesUnderstanding MySql locking issues
Understanding MySql locking issues
 
Barcelona mysqlnd qc
Barcelona mysqlnd qcBarcelona mysqlnd qc
Barcelona mysqlnd qc
 

Viewers also liked

The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLMorgan Tocker
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsTuyen Vuong
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMorgan Tocker
 
Mastering InnoDB Diagnostics
Mastering InnoDB DiagnosticsMastering InnoDB Diagnostics
Mastering InnoDB Diagnosticsguest8212a5
 
1&1 MySQL Experience at SkySQL Roadshow
1&1 MySQL Experience at SkySQL Roadshow1&1 MySQL Experience at SkySQL Roadshow
1&1 MySQL Experience at SkySQL RoadshowMariaDB Corporation
 
MySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA optionsMySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA optionsTed Wennmark
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and EngineAbdul Manaf
 
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevInnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevFuenteovejuna
 
MariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineMariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineKangaroot
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMark Swarbrick
 
Web vulnerability seminar2
Web vulnerability seminar2Web vulnerability seminar2
Web vulnerability seminar2Sakuya Izayoi
 
GoldenGate for MySQL 설치 시 필요한 사항
GoldenGate for MySQL 설치 시 필요한 사항GoldenGate for MySQL 설치 시 필요한 사항
GoldenGate for MySQL 설치 시 필요한 사항정명훈 Jerry Jeong
 
Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0sprdd
 
The care and feeding of a MySQL database
The care and feeding of a MySQL databaseThe care and feeding of a MySQL database
The care and feeding of a MySQL databaseDave Stokes
 
Performance Schema in MySQL (Danil Zburivsky)
Performance Schema in MySQL (Danil Zburivsky)Performance Schema in MySQL (Danil Zburivsky)
Performance Schema in MySQL (Danil Zburivsky)Ontico
 
The MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS SchemaThe MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS SchemaTed Wennmark
 
MySQL Performance - SydPHP October 2011
MySQL Performance - SydPHP October 2011MySQL Performance - SydPHP October 2011
MySQL Performance - SydPHP October 2011Graham Weldon
 
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance SchemaMySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance SchemaSveta Smirnova
 

Viewers also liked (19)

The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and Concepts
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Mastering InnoDB Diagnostics
Mastering InnoDB DiagnosticsMastering InnoDB Diagnostics
Mastering InnoDB Diagnostics
 
1&1 MySQL Experience at SkySQL Roadshow
1&1 MySQL Experience at SkySQL Roadshow1&1 MySQL Experience at SkySQL Roadshow
1&1 MySQL Experience at SkySQL Roadshow
 
MySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA optionsMySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA options
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and Engine
 
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter ZaitsevInnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter Zaitsev
 
MariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineMariaDB: Connect Storage Engine
MariaDB: Connect Storage Engine
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication Webinar
 
Web vulnerability seminar2
Web vulnerability seminar2Web vulnerability seminar2
Web vulnerability seminar2
 
GoldenGate for MySQL 설치 시 필요한 사항
GoldenGate for MySQL 설치 시 필요한 사항GoldenGate for MySQL 설치 시 필요한 사항
GoldenGate for MySQL 설치 시 필요한 사항
 
Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0
 
The care and feeding of a MySQL database
The care and feeding of a MySQL databaseThe care and feeding of a MySQL database
The care and feeding of a MySQL database
 
Performance Schema in MySQL (Danil Zburivsky)
Performance Schema in MySQL (Danil Zburivsky)Performance Schema in MySQL (Danil Zburivsky)
Performance Schema in MySQL (Danil Zburivsky)
 
The MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS SchemaThe MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS Schema
 
MySQL Performance - SydPHP October 2011
MySQL Performance - SydPHP October 2011MySQL Performance - SydPHP October 2011
MySQL Performance - SydPHP October 2011
 
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance SchemaMySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance Schema
 

Similar to MySQL For Linux Sysadmins

Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQLTed Wennmark
 
MySQL London Tech Tour March 2015 - Embedded Database of Choice
MySQL London Tech Tour March 2015 - Embedded Database of ChoiceMySQL London Tech Tour March 2015 - Embedded Database of Choice
MySQL London Tech Tour March 2015 - Embedded Database of ChoiceMark Swarbrick
 
Oracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLOracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLMario Beck
 
Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Updated Power of the AWR Warehouse, Dallas, HQ, etc.Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Updated Power of the AWR Warehouse, Dallas, HQ, etc.Kellyn Pot'Vin-Gorman
 
New data dictionary an internal server api that matters
New data dictionary an internal server api that mattersNew data dictionary an internal server api that matters
New data dictionary an internal server api that mattersAlexander Nozdrin
 
Power of the AWR Warehouse- HotSos Symposium 2015
Power of the AWR Warehouse-  HotSos Symposium 2015Power of the AWR Warehouse-  HotSos Symposium 2015
Power of the AWR Warehouse- HotSos Symposium 2015Kellyn Pot'Vin-Gorman
 
Oracle database in cloud, dr in cloud and overview of oracle database 18c
Oracle database in cloud, dr in cloud and overview of oracle database 18cOracle database in cloud, dr in cloud and overview of oracle database 18c
Oracle database in cloud, dr in cloud and overview of oracle database 18cAiougVizagChapter
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementMark Matthews
 
Simplify IT: Oracle SuperCluster
Simplify IT: Oracle SuperCluster Simplify IT: Oracle SuperCluster
Simplify IT: Oracle SuperCluster Fran Navarro
 
Oracle EM12c Release 4 New Features!
Oracle EM12c Release 4 New Features!Oracle EM12c Release 4 New Features!
Oracle EM12c Release 4 New Features!Kellyn Pot'Vin-Gorman
 
5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQLMySQL Brasil
 
Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Kellyn Pot'Vin-Gorman
 
Kscope Not Your Father's Enterprise Manager
Kscope Not Your Father's Enterprise ManagerKscope Not Your Father's Enterprise Manager
Kscope Not Your Father's Enterprise ManagerKellyn Pot'Vin-Gorman
 
Coherence 12.1.3 hidden gems
Coherence 12.1.3 hidden gemsCoherence 12.1.3 hidden gems
Coherence 12.1.3 hidden gemsharvraja
 

Similar to MySQL For Linux Sysadmins (20)

Apouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12cApouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12c
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
MySQL London Tech Tour March 2015 - Embedded Database of Choice
MySQL London Tech Tour March 2015 - Embedded Database of ChoiceMySQL London Tech Tour March 2015 - Embedded Database of Choice
MySQL London Tech Tour March 2015 - Embedded Database of Choice
 
Oracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLOracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQL
 
Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Updated Power of the AWR Warehouse, Dallas, HQ, etc.Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Updated Power of the AWR Warehouse, Dallas, HQ, etc.
 
New data dictionary an internal server api that matters
New data dictionary an internal server api that mattersNew data dictionary an internal server api that matters
New data dictionary an internal server api that matters
 
Power of the AWR Warehouse
Power of the AWR WarehousePower of the AWR Warehouse
Power of the AWR Warehouse
 
Power of the AWR Warehouse- HotSos Symposium 2015
Power of the AWR Warehouse-  HotSos Symposium 2015Power of the AWR Warehouse-  HotSos Symposium 2015
Power of the AWR Warehouse- HotSos Symposium 2015
 
OOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-SharableOOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-Sharable
 
MySQL Replication
MySQL ReplicationMySQL Replication
MySQL Replication
 
Oracle database in cloud, dr in cloud and overview of oracle database 18c
Oracle database in cloud, dr in cloud and overview of oracle database 18cOracle database in cloud, dr in cloud and overview of oracle database 18c
Oracle database in cloud, dr in cloud and overview of oracle database 18c
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance Improvement
 
Oracle NoSQL
Oracle NoSQLOracle NoSQL
Oracle NoSQL
 
Simplify IT: Oracle SuperCluster
Simplify IT: Oracle SuperCluster Simplify IT: Oracle SuperCluster
Simplify IT: Oracle SuperCluster
 
Oracle EM12c Release 4 New Features!
Oracle EM12c Release 4 New Features!Oracle EM12c Release 4 New Features!
Oracle EM12c Release 4 New Features!
 
Developer day v2
Developer day v2Developer day v2
Developer day v2
 
5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL
 
Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016
 
Kscope Not Your Father's Enterprise Manager
Kscope Not Your Father's Enterprise ManagerKscope Not Your Father's Enterprise Manager
Kscope Not Your Father's Enterprise Manager
 
Coherence 12.1.3 hidden gems
Coherence 12.1.3 hidden gemsCoherence 12.1.3 hidden gems
Coherence 12.1.3 hidden gems
 

More from Morgan Tocker

Introducing Spirit - Online Schema Change
Introducing Spirit - Online Schema ChangeIntroducing Spirit - Online Schema Change
Introducing Spirit - Online Schema ChangeMorgan Tocker
 
MySQL Usability Guidelines
MySQL Usability GuidelinesMySQL Usability Guidelines
MySQL Usability GuidelinesMorgan Tocker
 
My First 90 days with Vitess
My First 90 days with VitessMy First 90 days with Vitess
My First 90 days with VitessMorgan Tocker
 
FOSDEM MySQL and Friends Devroom
FOSDEM MySQL and Friends DevroomFOSDEM MySQL and Friends Devroom
FOSDEM MySQL and Friends DevroomMorgan Tocker
 
Introducing TiDB - Percona Live Frankfurt
Introducing TiDB - Percona Live FrankfurtIntroducing TiDB - Percona Live Frankfurt
Introducing TiDB - Percona Live FrankfurtMorgan Tocker
 
TiDB Introduction - Boston MySQL Meetup Group
TiDB Introduction - Boston MySQL Meetup GroupTiDB Introduction - Boston MySQL Meetup Group
TiDB Introduction - Boston MySQL Meetup GroupMorgan Tocker
 
TiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL MeetupTiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL MeetupMorgan Tocker
 
MySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer GuideMySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer GuideMorgan Tocker
 
MySQL Cloud Service Deep Dive
MySQL Cloud Service Deep DiveMySQL Cloud Service Deep Dive
MySQL Cloud Service Deep DiveMorgan Tocker
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated TestingMorgan Tocker
 

More from Morgan Tocker (11)

Introducing Spirit - Online Schema Change
Introducing Spirit - Online Schema ChangeIntroducing Spirit - Online Schema Change
Introducing Spirit - Online Schema Change
 
MySQL Usability Guidelines
MySQL Usability GuidelinesMySQL Usability Guidelines
MySQL Usability Guidelines
 
My First 90 days with Vitess
My First 90 days with VitessMy First 90 days with Vitess
My First 90 days with Vitess
 
FOSDEM MySQL and Friends Devroom
FOSDEM MySQL and Friends DevroomFOSDEM MySQL and Friends Devroom
FOSDEM MySQL and Friends Devroom
 
Introducing TiDB - Percona Live Frankfurt
Introducing TiDB - Percona Live FrankfurtIntroducing TiDB - Percona Live Frankfurt
Introducing TiDB - Percona Live Frankfurt
 
TiDB Introduction - Boston MySQL Meetup Group
TiDB Introduction - Boston MySQL Meetup GroupTiDB Introduction - Boston MySQL Meetup Group
TiDB Introduction - Boston MySQL Meetup Group
 
TiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL MeetupTiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL Meetup
 
TiDB Introduction
TiDB IntroductionTiDB Introduction
TiDB Introduction
 
MySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer GuideMySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer Guide
 
MySQL Cloud Service Deep Dive
MySQL Cloud Service Deep DiveMySQL Cloud Service Deep Dive
MySQL Cloud Service Deep Dive
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated Testing
 

Recently uploaded

20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 

Recently uploaded (20)

20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 

MySQL For Linux Sysadmins

  • 1.
  • 2. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | MySQL  For  Linux   Sysadmins Morgan  Tocker   MySQL  Community  Manager   August,  2014
  • 3. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Safe  Harbor  Statement The  following  is  intended  to  outline  our  general  product  direction.   It  is  intended  for  information  purposes  only,  and  may  not  be   incorporated  into  any  contract.  It  is  not  a  commitment  to  deliver   any  material,  code,  or  functionality,  and  should  not  be  relied  upon   in  making  purchasing  decisions.  The  development,  release,  and   timing  of  any  features  or  functionality  described  for  Oracle’s   products  remains  at  the  sole  discretion  of  Oracle. Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 3
  • 4. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 4 Program  Agenda Introduction   MySQL  Architecture   Backup  &  Replication   Performance  &  Capacity  Planning 1 2 3 4
  • 5. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | The  Career  Path  to  DBA • Start  as  a  Developer   • Start  as  a  Sysadmin   • Train  to  be  a  DBA 5 Usually either #1 or #2. I started as a Developer }
  • 6. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Non  Exhaustive  List  of  Duties • Backup   • Replication   • Patching  &  Upgrades   • Performance  and  Capacity  Planning   • Coaching  &  Mentoring   • Fighting  Fires 6
  • 7. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 7 Program  Agenda Introduction   MySQL  Architecture   Backup  &  Replication   Performance  &  Capacity  Planning 1 2 3 4 2 1
  • 8. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | About  MySQL • Version  numbers  are  misleading:   • 5.5  to  5.6  was  the  biggest  upgrade  in  history   • 5.6.xx   • Micro-­‐release  approximately  every  2  months.   • Fixes  bugs  and  security  vulnerabilities. 8
  • 9. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | About  MySQL  (cont.) • 5.7.xx   • Current  focus  of  development.   • Release  cycle  is  2-­‐3  years.   • 5.5  and  5.6  are  under  active  support. 9
  • 10. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 10
  • 11. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Storage  Engines  in  MySQL • InnoDB  (default)   • MyISAM  (previous  default)   • NDB  Cluster   • Other 11
  • 12. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Memory  Usage • Databases  like  to  allocate  large  amounts  of  memory   for  caches   • Better  to  run  with  smaller  caches  than  swap   • Kind  of  works  as  “double  buffering”  of  operating   system  caches 12
  • 13. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted MySQL  Server • Single  process  of  mysqld   • Supervisor  process  is  mysqld_safe   • Each  new  MySQL  connection  consumes  a  thread   • With  the  server  maintaining  a  small  thread  cache 13
  • 14. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 14 Transaction System StorageCaching SYS_TABLES ibdata1 space0 Page Cache A.ibd B.ibd C.ibd IBUF_HEADER IBUF_TREE TRX_SYS FIRST_RSEG DICT_HDR Data Dict. SYS_COLUMNS SYS_INDEXES SYS_FIELDS Block 1 (64 pages) Block 2 (64 pages) iblogfile0 iblogfile1 iblogfile2 Tables with file_per_tableDoublewrite Buffer BufferPool Data Dictionary Cache Adaptive Hash Indexes Buffer Pool LRU Additional Mem Pool Log Buffer LogGroup Buffer Pool Flush List In Memory On Diskhttps://github.com/jeremycole/innodb_diagrams
  • 15. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 15 InnoDBTransaction System StorageCaching SYS_TABLES ibdata1 space0 Page Cache A.ibd B.ibd C.ibd IBUF_HEADER IBUF_TREE TRX_SYS FIRST_RSEG DICT_HDR Data Dict. SYS_COLUMNS SYS_INDEXES SYS_FIELDS Block 1 (64 pages) Block 2 (64 pages) iblogfile0 iblogfile1 iblogfile2 Tables with file_per_tableDoublewrite Buffer BufferPool Data Dictionary Cache Adaptive Hash Indexes Buffer Pool LRU Additional Mem Pool Log Buffer LogGroup Buffer Pool Flush List SELECT * FROM a WHERE id = 10; mysqld Not Found Query  -­‐  Non  Cached
  • 16. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 16 InnoDBTransaction System StorageCaching SYS_TABLES ibdata1 space0 Page Cache A.ibd B.ibd C.ibd IBUF_HEADER IBUF_TREE TRX_SYS FIRST_RSEG DICT_HDR Data Dict. SYS_COLUMNS SYS_INDEXES SYS_FIELDS Block 1 (64 pages) Block 2 (64 pages) iblogfile0 iblogfile1 iblogfile2 Tables with file_per_tableDoublewrite Buffer BufferPool Data Dictionary Cache Adaptive Hash Indexes Buffer Pool LRU Additional Mem Pool Log Buffer LogGroup Buffer Pool Flush List SELECT * FROM a WHERE id = 10; mysqld Query  -­‐  Cached
  • 17. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 17 Update  Query  in  a     Transaction  (simplified) InnoDB Transaction System StorageCaching SYS_TABLES ibdata1 space0 Page Cache A.ibd B.ibd C.ibd IBUF_HEADER IBUF_TREE TRX_SYS FIRST_RSEG DICT_HDR Data Dict. SYS_COLUMNS SYS_INDEXES SYS_FIELDS Block 1 (64 pages) Block 2 (64 pages) iblogfile0 iblogfile1 iblogfile2 Tables with file_per_tableDoublewrite Buffer BufferPool Data Dictionary Cache Adaptive Hash Indexes Buffer Pool LRU Additional Mem Pool Log Buffer LogGroup Buffer Pool Flush List UPDATE a SET col1 = ‘new’ WHERE id = 10; mysqld commit;
  • 18. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Log  Files • Provide  recovery.   • Only  written  to  in  regular  operation.   • Read  only  required  if  there  is  a  crash.   • Are  rewritten  over-­‐and-­‐over  again.   • Think  of  it  like  a  tank  tread. 18
  • 19. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 19 Program  Agenda Introduction   MySQL  Architecture   Backup  &  Replication   Performance  &  Capacity  Planning 1 2 3 4 1 3
  • 20. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Backup  (Theory) • Cold   • Warm   • Hot 20
  • 21. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Backup  Consistency • Must  represent  a  single  point  in  time 21
  • 22. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | 22 customerid name 1 Acorn Enterprises 2 First National Squirrel Bank 3 Squirrels 5000 Inc invoiceid customerid ... 1 1 # Acorn Enterprises 2 1 # Acorn Enterprises 3 3 # Squirrels 5000 Inc customer invoice itemid invoiceid Description Amount 1 1 1 hrs Professional Services $10 2 2 Acorn Parts $12.50 3 2 5 hrs Professional Services $50 4 3 Delivery Fee $17.50 5 3 Replacement Acorn $20 invoice_item
  • 23. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | 23 customerid name 1 Acorn Enterprises 2 First National Squirrel Bank 3 Squirrels 5000 Inc invoiceid customerid ... 1 1 # Acorn Enterprises 2 1 # Acorn Enterprises 3 3 # Squirrels 5000 Inc customer invoice itemid invoiceid Description Amount 1 1 1 hrs Professional Services $10 2 2 Acorn Parts $12.50 3 2 5 hrs Professional Services $50 4 3 Delivery Fee $17.50 5 3 Replacement Acorn $20 invoice_item
  • 24. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | 24 customerid name 1 Acorn Enterprises 2 First National Squirrel Bank 3 Squirrels 5000 Inc invoiceid customerid ... 1 1 # Acorn Enterprises 2 1 # Acorn Enterprises 3 3 # Squirrels 5000 Inc customer invoice itemid invoiceid Description Amount 1 1 1 hrs Professional Services $10 2 2 Acorn Parts $12.50 3 2 5 hrs Professional Services $50 4 3 Delivery Fee $17.50 5 3 Replacement Acorn $20 invoice_item
  • 25. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | 25 customerid name 1 Acorn Enterprises 2 First National Squirrel Bank 3 Squirrels 5000 Inc 4 Savvy Squirrel Global invoiceid customerid ... 1 1 # Acorn Enterprises 2 1 # Acorn Enterprises 3 3 # Squirrels 5000 Inc 4 4 # Savvy Squirrels customer invoice itemid invoiceid Description Amount 1 1 1 hrs Professional Services $10 2 2 Acorn Parts $12.50 3 2 5 hrs Professional Services $50 4 3 Delivery Fee $17.50 5 3 Replacement Acorn $20 6 4 Premium Acorn $999 invoice_item
  • 26. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | 26 customerid name 1 Acorn Enterprises 2 First National Squirrel Bank 3 Squirrels 5000 Inc 4 Savvy Squirrel Global invoiceid customerid ... 1 1 # Acorn Enterprises 2 1 # Acorn Enterprises 3 3 # Squirrels 5000 Inc 4 4 # Savvy Squirrels customer invoice itemid invoiceid Description Amount 1 1 1 hrs Professional Services $10 2 2 Acorn Parts $12.50 3 2 5 hrs Professional Services $50 4 3 Delivery Fee $17.50 5 3 Replacement Acorn $20 6 4 Premium Acorn $999 invoice_item
  • 27. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | 27 customerid name 1 Acorn Enterprises 2 First National Squirrel Bank 3 Squirrels 5000 Inc 4 Savvy Squirrel Global invoiceid customerid ... 1 1 # Acorn Enterprises 2 1 # Acorn Enterprises 3 3 # Squirrels 5000 Inc 4 4 # Savvy Squirrels customer invoice itemid invoiceid Description Amount 1 1 1 hrs Professional Services $10 2 2 Acorn Parts $12.50 3 2 5 hrs Professional Services $50 4 3 Delivery Fee $17.50 5 3 Replacement Acorn $20 6 4 Premium Acorn $999 invoice_item
  • 28. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | 28 customerid name 1 Acorn Enterprises 2 First National Squirrel Bank 3 Squirrels 5000 Inc 4 Savvy Squirrel Global invoiceid customerid ... 1 1 # Acorn Enterprises 2 1 # Acorn Enterprises 3 3 # Squirrels 5000 Inc 4 4 # Savvy Squirrels customer invoice itemid invoiceid Description Amount 1 1 1 hrs Professional Services $10 2 2 Acorn Parts $12.50 3 2 5 hrs Professional Services $50 4 3 Delivery Fee $17.50 5 3 Replacement Acorn $20 6 4 Premium Acorn $999 invoice_item
  • 29. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Backup  Methods • mysqldump   • Is  warm  by  default.    Can  safely  be  set  hot  if  all  InnoDB.   • Logical  backup.    Slow  to  recover.   • Snapshot  Based  -­‐  i.e.  LVM  snapshot.   • Consistent  +  Hot   • May  have  higher  impact  during  snapshot  phase.   • Best  used  with  a  script  like  mylvmbackup. 29
  • 30. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Backup  Methods  (cont.) • MySQL  Enterprise  Backup   • Commercial  Tool   • Hot  with  InnoDB.    Warm  for  MyISAM  phase   • Low  Impact 30
  • 31. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | How  to  Decide? • MTTR  of  logical  backups  is  much  higher.   • Most  failures  are  accidents  (either  by  DBA  or  user).   • “I  accidentally  updated  the  phone  number  of  the   wrong  customer!” 31
  • 32. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Replication • Built  in  to  MySQL   • Easy  to  setup  and  get  running   • Uses  same  port  3306   • Most  deployments  will  use  Replication 32
  • 33. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Replication  Options • Row  Format   • Statement  Based  (default)   • Row  Based   • Global  Transaction  IDs   • Semi-­‐Synchronous   • Time  delayed 33
  • 34. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 34 Program  Agenda Introduction   MySQL  Architecture   Backup  &  Replication   Performance  &  Capacity  Planning 1 2 3 4 1 4
  • 35. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Quality  of  Service • Often  better  to  let  one  too  demanding  user  go   unserviced  than  all  users  go  unserviced   • Statement  Timeout  coming  to  MySQL  5.7. 35
  • 36. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Quality  of  Service  (cont.) • Replication  Slaves,  Hadoop  very  useful.   • Important  to  Optimize  for  Response  Time  (user  facing)   before  sub  optimizing  for  background  tasks. 36
  • 37. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Configuration Most  important  settings • innodb_buffer_pool_size  -­‐  50-­‐80%  of  memory   • innodb_log_file_size  -­‐  up  to  4G  quite  safe 37
  • 38. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Configuration Also  Useful • innodb_flush_method   • innodb_flush_neighbors   • innodb_io_capacity  and  innodb_lru_scan_depth   • Explained  here:   • http://www.tocker.ca/2013/09/17/what-­‐to-­‐tune-­‐in-­‐ mysql-­‐56-­‐after-­‐installation.html 38
  • 39. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted How  much  can  you  expect  from  config? Versus  other  optimizations • Optimizing  Queries  is  critical  to  performance   • SQL  is  hard   • Easy  to  write   • Hard  to  sight  check  for  performance 39
  • 40. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted How  to  find  slow  queries? • Pro-­‐active:   • Design  or  review  all  schema  and  queries.   • Re-­‐active:   • Find  worst  offenders  and  suggest  improvements  to   development  staff. 40
  • 41. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Realistic  Compromise • Query  and  index  usage  changes  over  time   • You  have  to  have  tools  in  place  to  find  slow  SQL   • We  release  MySQL  Enterprise  Monitor  for  this  purpose 41
  • 42. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Hardware  Choices • Frequently  memory  is  under-­‐provisioned   • http://rhaas.blogspot.ca/2014/08/memory-­‐ matters.html  (PostgreSQL)   • http://www.tocker.ca/2013/05/10/twice-­‐as-­‐much-­‐ ram-­‐does-­‐not-­‐equal-­‐twice-­‐as-­‐fast.html  (Me;  MySQL) 42
  • 43. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Hardware  Choices  (cont.) • SSD  transition  is  real   • But  still  better  to  buy  more  memory  first   • Database  need  to  write  for  persistence.    Heavier  IO   requirements  than  any  other  tier 43
  • 44. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted Hardware  Choices  (cont.) • More  CPUs  can  mean  more  consistent  performance   • Some  level  of  scale  up  +  scale  out  is  best:   • http://www.tocker.ca/2014/04/22/five-­‐reasons-­‐why-­‐ vertical-­‐scalability-­‐matters.html   44
  • 45. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Non  Exhaustive  List  of  Duties • Backup   • Replication   • Patching  &  Upgrades   • Performance  and  Capacity  Planning   • Coaching  &  Mentoring   • Fighting  Fires 45
  • 46. Copyright  ©  2014  Oracle  and/or  its  affiliates.  All  rights  reserved.    | Oracle  Confidential  –  Internal/Restricted/Highly  Restricted 46