Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Why MySQL High Availability Matters
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Why	MySQL	High	Availability	MaFers	
MaF	Lord	
MySQL	Product	Manager	
@maFalord
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Safe	Harbor	Statement	
The	following	is	intended	to	outline	our	general	product	direcNon.	It	is	intended	for	
informaNon	purposes	only,	and	may	not	be	incorporated	into	any	contract.	It	is	not	a	
commitment	to	deliver	any	material,	code,	or	funcNonality,	and	should	not	be	relied	upon	
in	making	purchasing	decisions.	The	development,	release,	and	Nming	of	any	features	or	
funcNonality	described	for	Oracle’s	products	remains	at	the	sole	discreNon	of	Oracle.	
3
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Program	Agenda	
4	
High	Availability	Explained		
NaNve	MySQL	High	Availability	
Highly	Available	MySQL	Reference	Architectures		
What’s	Coming	Next	for	MySQL	HA	and	Scale?	
1	
2	
3	
4
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Program	Agenda	
5	
High	Availability	Explained		
NaNve	MySQL	High	Availability	
Highly	Available	MySQL	Reference	Architectures		
What’s	Coming	Next	for	MySQL	HA	and	Scale?	
1	
2	
3	
4
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	Terms	and	Concepts	
•  Availability		
– Outage	and	downNme	
– Mean	Time	Between	Failures	(MTBF)	
– Mean	Time	To	Recover	(MTTR)		
– Service	Level	Agreement	(SLA)	
– The	Nine’s	Scale	:	5	nines	=	5	mins	downNme	per	year	
•  Capacity	/	Performance		
•  Redundancy	
•  Fault	Tolerance	
•  Disaster	Tolerance/Recovery	
6
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	ConsideraNons	
•  SLA	requirements	
– What	is	needed	to	support	your	business	objecNves	
•  OperaNonal	capabiliNes	
– Will	you	have	the	workforce	to	implement	and	maintain	it	
•  Service	agility	
– Can	it	grow	and	change	as	your	company	does	
•  Time	to	market	
– Can	you	go	to	market	quickly	
•  Budgetary	constraints	
– Cost	of	downNme	versus	cost	of	HA	implementaNon	
7	
	What	To	Use?
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	Factors	
•  Environment	
– Redundant	servers	in	different	datacenters	and	geographical	areas	will	protect	you	
against	regional	issues—power	grid	failures,	hurricanes,	earthquakes,	etc.	
•  Hardware	
– Each	part	of	your	hardware	stack—networking,	storage,	servers—should	be	redundant	
•  Sogware	
– Every	layer	of	the	sogware	stack	needs	to	be	duplicated	and	distributed	across	
separate	hardware	and	environments		
•  Data	
– Data	loss	and	inconsistency/corrupNon	must	be	prevented	by	having	mulNple	copies	of	
each	piece	of	data,	with	consistency	checks	and	guarantees	for	each	change		
8
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	Design	Factors	
•  Reliability,	Availability,	and	Serviceability	(RAS)	
– Reliability	
•  Quality	hardware	and	sogware	components	that	you	can	manage	and	trust	
– Availability	
•  MulNple	copies	of	each	datum	replicated	to	separate	hardware	
•  MulNple	copies	of	each	piece	of	the	hardware	and	sogware	stack	
•  MulNple	physical	locaNons	
– Separate	power	grids		
– Enough	physical	distance	to	survive	disasters	such	as	floods,	earthquakes,	and	power	grid	outages	
•  Resiliency		
– AutomaNon	to	transparently	deal	with	any	potenNal	failure	in	the	infrastructure,	hardware,	sogware	
– Serviceability		
•  Ensure	that	you	can	monitor,	diagnose,	maintain,	and	repair	it	all	
9
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	Acceptable	Performance	
•  Performance	outside	of	acceptable	bounds	is	unavailability	
– Determine	your	acceptable	applicaNon	response	Nmes		
– Ensure	that	you	can	measure	impact	from	each	layer	of	stack	
– Determine	failure	versus	load		
•  Scale	up/out	or	failover		
•  Build	elasNcity	into	each	layer	
– Quickly	and	easily	scale	up	and	down	to	handle	changing	load	and	traffic	paFerns	
10
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	The	Causes	of	DownNme	
11	
40%	
40%	
20%	
Sogware/ApplicaNon	 Human	Error	 Hardware	
*	Source:	Gartner		Group	1998	survey		
A	study	by	the	Gartner	Group	
projected	that	through	2015,	
80%	of	downNme	will	be	due	
to	people	and	process	issues
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	The	Business	Cost	of	DownNme	
•  Calculate	a	cost	per	minute	of	downNme		
– Average	revenue	generated	per-minute	over	a	year		
– Cost	of	not	meeNng	any	customer	SLAs	
– Factor	in	costs	that	are	harder	to	quanNfy	
1.  Revenue	
2.  ReputaNon		
3.  Customer	senNment	
4.  Stock	price		
5.  Service’s	success		
6.  Company’s	very	existence		
12	
THIS is	why	
HA	ma;ers!
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
High	Availability:	Database	Needs	
•  Management	infrastructure		
– Monitoring	of	status,	health,	performance	
•  FaciliNes	for	service	changes,	service	transiNons	
•  Failure	detecNon	and	handling	
– IdenNfy	and	handle	failures		
•  ElasNcity	
– Scale	up	to	ensure	acceptable	performance	is	always	maintained	
•  Consistency	guarantees		
– Conflict	detecNon	and	handling	;	data	loss	protecNon/prevenNon	
•  Online	maintenance	
13
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
•  Recovery	Time	ObjecNve	
– Maximum	length	of	downNme	before	
there	is	break	in	“business	conNnuity”	
	
•  Recovery	Point	ObjecNve	
– Point	in	Nme	to	which	data	must	be	
recovered	when	service	is	re-
established	
Tier 1	
•  Mission-critical services	
Tier 2
•  Business-critical services
Tier 3
•  Task-critical services
Tier 4
•  Non-critical services
14	
High	Availability:	Does	The	ApplicaNon	Require	It?
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	
Master/Slave	
ReplicaEon	
Master/Slave	
with	Automated	
Failover		
DRBD	
OS	or	VM	
vendor	acEve/
passive	
soluEons	
MySQL	Group	
ReplicaEon	
High	Availability:	Common	MySQL	SoluNons	
9	 9	 .	 9	 9	 9	 %	
15	
ConEnuous	
Availability
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Program	Agenda	
16	
High	Availability	Explained		
NaNve	MySQL	High	Availability	
Highly	Available	MySQL	Reference	Architectures		
What’s	Coming	Next	for	MySQL	HA	and	Scale?	
1	
2	
3	
4
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
C	
B	
A	
C	
B	
A	CRASH	
C	
B	
A	
Now	B	is	the	
new	master	
Uh	Oh!	 It’s	OK!	
	A	major	building	block	for	high	availability	
	
What	is	ReplicaNon	Used	For?	
17
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Group	ReplicaEon	
18	
App	Servers	with	
MySQL	Router	
MySQL	Group	ReplicaNon	
			“High	Availability	becomes	a	core	
						first	class	feature	of	MySQL!”
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Group	ReplicaNon:	What	Is	It?	
•  Group	ReplicaNon	library	
– ImplementaNon	of	Replicated	Database	State	Machine	
theory	
•  MySQL	GCS	is	based	on	Paxos	(variant	of	Mencius)	
– Provides	virtually	synchronous	replicaNon	for	MySQL	5.7+	
– Supported	on	all	MySQL	pla>orms	
•  Linux,	Windows,	Solaris,	OSX,	FreeBSD	
	
“Mul?-master	update	anywhere	replica?on	plugin	for	MySQL	with	
built-in	conflict	detec1on	and	resolu1on,	automa1c	distributed	
recovery,	and	group	membership.”	
	
	 19	
App	Servers	with	
MySQL	Router	
MySQL	Group	ReplicaNon
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
•  A	highly	available	distributed	MySQL	database	service	
– Clustering	eliminates	single	points	of	failure	(SPOF)	
•  Allows	for	online	maintenance	
– Removes	the	need	for	manually	handling	server	fail-over	
– Provides	distributed	fault	tolerance	and	self-healing	
– Enables	AcNve/AcNve	update	anywhere	setups	
– Automates	reconfiguraNon	(adding/removing	nodes,	crashes,	failures)		
– Makes	it	easy	to	scale	up/down	based	on	demand	
– AutomaNcally	ensures	data	consistency	
•  Detects	and	handles	conflicts	
•  Prevents	data	loss		
•  Prevents	data	corrupNon	
20	
MySQL	Group	ReplicaNon:	What	Does	It	Provide?
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Group	ReplicaNon:	Use	Cases	
•  ElasEc	ReplicaEon	
– Environments	that	require	a	very	fluid	replicaNon	infrastructure,	where	the	number	
of	servers	has	to	grow	or	shrink	dynamically	and	with	liFle	pain	as	possible.	
•  Highly	Available	Shards	
– Sharding	is	a	popular	approach	to	achieve	write	scale-out.	Users	can	use	MySQL	
Group	ReplicaNon	to	implement	highly	available	shards	in	a	federated	system.		Each	
shard	can	map	into	a	ReplicaNon	Group.	
•  AlternaEve	to	Master-Slave	ReplicaEon	
– It	may	be	that	a	single	master	server	makes	it	a	single	point	of	contenNon.	WriNng	to	
an	enNre	group	may	prove	more	scalable	under	certain	circumstances.	
21
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Group	ReplicaNon:	What	Sets	It	Apart?	
•  Built	by	the	MySQL	Engineering	Team	
– NaNvely	integrated	into	Server:	InnoDB,	ReplicaNon,	GTIDs,	Performance	Schema,	SYS	
– Built-in,	no	need	for	separate	downloads	
– Available	on	all	plaxorms	[Linux,	Windows,	Solaris,	FreeBSD,	etc]	
•  BeFer	performance	than	similar	offerings	
– MySQL	GCS	has	opNmized	network	protocol	that	reduces	the	impact	on	latency	
•  Easier	monitoring		
– Simple	Performance	Schema	tables	for	group	and	node	status/stats	
– NaNve	support	for	Group	ReplicaNon	coming	to	MySQL	Enterprise	Monitor	
•  Modern	full	stack	MySQL	HA	being	built	around	it		
– NaNve	end-to-end	easy	to	use	sharded	InnoDB	clusters	
22
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Group	ReplicaNon:	Architecture	
Node	Types	
R:	Traffic	routers/proxies:	mysqlrouter,	haproxy,	sqlproxy,	...	
M:	mysqld	nodes	parNcipaNng	in	Group	ReplicaNon		
	 23
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Group	ReplicaNon:	Stack	
•  The	Group	ReplicaNon	plugin	is	responsible	for	
– Maintaining	distributed	execuNon	context	
– DetecNng	and	handling	conflicts	
– Handling	distributed	recovery	
•  Detect	membership	changes	
•  Donate	state	if	needed	
•  Collect	state	if	needed	
– Proposing	transacNons	to	other	members	
– Receiving	and	handling	transacNons	from	other	
members	
– Deciding	the	ulNmate	fate	of	transacNons	
•  commit	or	rollback	
24	
	
GCS	API	
ReplicaEon	
Plugin	
Plugin	API	
MySQL	
Server	
Group Comm.
System (Corosync)
Group	Com.	Engine
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Group	ReplicaNon:	Stack	
•  The	Group	CommunicaNon	System	API:	
– Abstracts	the	underlying	group	communicaNon	system	
implementaNon	from	the	plugin	itself	
– Maps	the	interface	to	a	specific	group	communicaNon	
system	implementaNon	
•  The	Group	CommunicaNon	System	engine:	
– Variant	of	Paxos	developed	at	MySQL	
– Building	block	to	provide	distributed	agreement	
between	servers	
25	
	
GCS	API	
ReplicaEon	
Plugin	
Plugin	API	
MySQL	
Server	
Group Comm.
System (Corosync)
Group	Com.	Engine
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Group	ReplicaNon:	Performance	Comparison	
26
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Router	
•  Transparent	client	connecNon	rouNng	
– Load	balancing	
– ApplicaNon	connecNon	failover	
•  Stateless	design	offers	easy	HA	client	rouNng	
– A	local	Router	becomes	part	of	the	applicaNon	stack	
	
	”MySQL	Router	allows	you	to	easily	migrate	your	standalone	MySQL	
instances	to	na?vely	distributed	and	highly	available	Group	
Replica?on	clusters	without	affec?ng	exis?ng	applica?ons!”	
27	
Transparent	Access	to	HA	Databases	for	MySQL	ApplicaEons	
App	Servers	with	
MySQL	Router	
MySQL	Group	ReplicaNon
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Program	Agenda	
28	
High	Availability	Explained		
NaNve	MySQL	High	Availability	
Highly	Available	MySQL	Reference	Architectures		
What’s	Coming	Next	for	MySQL	HA	and	Scale?	
1	
2	
3	
4
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Hardware	and	Infrastructure	Notes		
•  3,	5,	or	7	machines	per	group	
– Isolate	machine	resources	as	much	as	possible		
– Limit	virtualizaNon	layers	
– Machines	configured	for	dedicated	database	server	role	
•  Recommended	configuraNon	
– 32-64	vCPUs		with	fast	CPU	clock	(2.5GHz+)	
– SSDs	(for	data	and	replicaNon	logs)	
– High	quality	network	connecNon	between	each	machine	
•  Low	latency,	high	throughput,	reliable		
•  Limit	routers	and	hubs	as	much	as	possible		
•  Isolated	and	dedicated	network	when	possible	
29
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Shared	Nothing	Cluster	–	Single	Data	Center	
30	
ApplicaEon	Servers	
MySQL	Router	in	Stack	
MySQL	Database	Service	
Group	ReplicaEon
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Shared	Nothing	Cluster	–	Cross	Data	Center	
31	
MySQL	Database	Service	
Group	ReplicaEon	
Data	Center	1	 Data	Center	2	
Clients
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Geographically	Redundant	Cluster	
32	
Async	ReplicaEon	
AcEve	Data	Center	 Backup	Data	Center	
Clients
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
AcNve/AcNve	MulN-Data	Center	Setup	
33	
Async	ReplicaEon	
Regional	Data	Center	 Regional	Data	Center	
Regional	Clients	Regional	Clients
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Program	Agenda	
34	
High	Availability	Explained		
NaNve	MySQL	High	Availability	
Highly	Available	MySQL	Reference	Architectures		
What’s	Coming	Next	for	MySQL	HA	and	Scale?	
1	
2	
3	
4
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	 35	
MySQL	Document	Store	
RelaNonal	&	Document	Models	
MySQL	HA	
Out-Of-Box	HA	
Read	Scale-Out	
Async	ReplicaNon	+	Auto	Failover	
Write	Scale-Out	
Sharding	
S1	
S2	
S3	
S4	
*	Download	InnoDB	Cluster	Preview	Release	from	labs.mysql.com
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Router:	2.1	
•  NaNve	support	for	InnoDB	clusters	
– Understands	Group	ReplicaNon	(GR)	topology	
– UNlizes	metadata	schema	stored	on	each	member	
•  Bootstraps	itself	and	sets	up	client	rouNng	for	the	GR	cluster		
•  Allows	for	intelligent	client	rouNng	into	the	GR	cluster	
•  Supports	mulN-master	and	single	primary	modes	
•  Core	improvements		
– Logging	
– Monitoring	
– Performance	
– Security		
36	
App	Servers	with	
MySQL	Router	
MySQL	Group	ReplicaNon	
MySQL	Shell	
Setup,	Manage,	
Orchestrate	
labs.mysql.com
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Shell	
37	
A	single	unified	client	for	all	administraEve	and	operaEons	tasks		
App	Servers	with	
MySQL	Router	
MySQL	Group	ReplicaNon	
MySQL	Shell	
Setup,	Manage,	
Orchestrate	
•  MulN-Language:	JavaScript,	Python,	and	SQL	
– Naturally	scriptable		
•  Supports	both	Document	and	RelaNonal	models	
•  Exposes	full	Development	and	Admin	API	
	
	”MySQL	Shell	provides	the	developer	and	DBA	with	a	single	intui?ve,	
flexible,	and	powerfull	interface	for	all	MySQL	related	tasks!”
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Shell:	Admin	API	
•  mysql-js>	dba.help()	
•  The	global	variable	'dba'	is	used	to	access	the	
MySQL	AdminAPI	
•  Perform	DBA	operaNons	
– Manage	MySQL	InnoDB	clusters	
•  Create	clusters	
•  Get	cluster	info		
•  Start/Stop	MySQL	Instances	
•  Validate	MySQL	instances		
•  …	
Database	AdministraEon	Interface	
labs.mysql.com	
App	Servers	with	
MySQL	Router	
MySQL	Group	ReplicaNon	
MySQL	Shell	
Setup,	Manage,	
Orchestrate	
38
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
MySQL	Enterprise	Monitor	
•  NaNve	holisNc	support	for	Group	ReplicaNon	clusters	
– Intelligent	monitoring	and	alerNng	
– Topology	views	
– Detailed	metrics	and	graphs	
– Best	PracNce	advice		
•  Monitoring	of	MySQL	Router	instances			
39
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Oracle	Cloud:	MySQL	Cloud	Service		
•  MySQL	Enterprise	EdiNon	
•  Web	based	console	to	manage	your	MySQL	Cloud	instances	
•  Self-Service	Provisioning	
•  ElasNc	Scalability	
•  MulN-Layered	Security	
•  Unified	Cloud	Management	
•  Oracle	PaaS	and	IaaS	IntegraNon	
•  Premier	Technical	Support	included		
40	
Integrated	HA	and	DR	
service	opEons	–	uElizing	
Group	ReplicaEon	–	
coming	soon!
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Always	On,	Without	Fail:	MySQL	Group	ReplicaEon	
	
Luis	Soares,	MySQL	ReplicaNon	Team	Lead,	Oracle		
Tuesday,	January	17,	2017	at	09:00	AM	Pacific	Standard	Time	
	
Register	now!	
Upcoming	Webinar	
41
Why MySQL High Availability Matters

More Related Content

Why MySQL High Availability Matters