server modeling with mysql

37
Server Modeling with Mysql [email protected]

Upload: dae-myung-kang

Post on 05-Dec-2014

674 views

Category:

Documents


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Server modeling with mysql

Server Modeling with Mysql

[email protected]

Page 2: Server modeling with mysql

Never Ending

Problem

Page 3: Server modeling with mysql

Scalability Consistency

Page 4: Server modeling with mysql

Scalability

Page 5: Server modeling with mysql

Problem Client Group

Web Server Web Server

Data Layer

Page 6: Server modeling with mysql

Easy Problem Client Group

Web Server Web Server

Data Layer

bottleneck

Page 7: Server modeling with mysql

Solution Client Group

Web Server Web Server

Data Layer

Scale up Scale out

Just Add Server

Web Server Web Server

Page 8: Server modeling with mysql

Hard Problem Client Group

Web Server Web Server

Data Layer

bottleneck

Page 9: Server modeling with mysql

Incorrect Solution Client Group

Web Server Web Server

Data Layer

Web Server Web Server

Bottleneck Harder!

Page 10: Server modeling with mysql

Scale up - Solution Client Group

Web Server Web Server

Data Layer

Need Money

Page 11: Server modeling with mysql

Scale Out - Solution Client Group

Web Server Web Server

Data Layer Data Layer

Partitioning

Page 12: Server modeling with mysql

How to Find Bottleneck

Page 13: Server modeling with mysql

Cpu load Iowait Log

netstat

Page 14: Server modeling with mysql

Test Test Test Test

Page 15: Server modeling with mysql

Consistency

Page 16: Server modeling with mysql

Master-Slave

Page 17: Server modeling with mysql

One Thing

Page 18: Server modeling with mysql

Master DB

Slave Slave Slave

Need 4 Servers for disater

Page 19: Server modeling with mysql

Master DB

Slave Slave Slave

Need 4 Servers for diaster

Fail Service Service

Page 20: Server modeling with mysql

Master DB

Slave Slave Slave

Need 4 Servers for diaster

New

Copy

Service Dump

Page 21: Server modeling with mysql

Master DB

Slave Slave Slave

Need 4 Servers for disater

Page 22: Server modeling with mysql

Many Person Knows

This Model

Page 23: Server modeling with mysql

1 Master N Slaves

Page 24: Server modeling with mysql

Master DB

Slave

Many Read, Small Write, and No Consistency Write

Read Read

Async Replication

Page 25: Server modeling with mysql

Master DB

Slave

Many Read, Small Write, and No Consistency Write ‘Data’

Read’Data’

Before Replication

Read Past Data

Page 26: Server modeling with mysql

Master DB

Slave

Many Read, Small Write, and No Consistency Write

Read Read

Page 27: Server modeling with mysql

How to Support Consistency?

Page 28: Server modeling with mysql

Distribution Transaction Processing

Page 29: Server modeling with mysql

2 Phase Commit

Page 30: Server modeling with mysql

Master DB

Slave

Prepare Phase Write

Write

Page 31: Server modeling with mysql

Master DB

Slave

Prepare Write

Write

Master DB

Slave

Commit Commit

Commit

Page 32: Server modeling with mysql

Semi-Sync With Mysql

Page 33: Server modeling with mysql

Master DB

Slave

Semi-Sync: Send ACK after sending log Write

Async Replication Ack

OK

Page 34: Server modeling with mysql

Mysql Cluster

Page 35: Server modeling with mysql

Old Version < 7.1 Just Use In-Memory

Page 36: Server modeling with mysql

Over 7.1 Use In-Memory Index

And Disk Data

Page 37: Server modeling with mysql

Thank you!