1 MariaDB Roadshow 2016 MariaDB Op*mizing for availability, scalability, and performance
1
MariaDBRoadshow2016
MariaDBOp*mizingforavailability,scalability,andperformance
2
Contents
Availability
Performance
Scalability
1.
2.
3.
SecurityStack• Data-at-RestEncrypBon• DatabaseFirewall• PasswordValidaBonandmore
HighAvailability• Built-inGaleraCluster
Replica*onScalability• NewReplicaBonMethods
Performance• InnoDBPageCompression• DefragmentaBon
NewinEnterpriseSpring2016
4
HighAvailabilityBackground
HighavailabilityisasystemdesignprotocolandassociatedimplementaBonthatensuresacertaindegreeofoperaBonalconBnuityduringagivenmeasurementperiod.
5
HighAvailabilityBackground
HighAvailabilityisn’talwaysthesameaslongUp*me• Asystemis“up”butmightsBllnotbeaccessible• Asystemthatis“down”justonce,butforalongBme,isn’thighlyavailable
HighAvailabilityrathermeans• LongMeanTimeBetweenFailures(MTBF)• ShortMeanTimeToRecover(MTTR)
6
HighAvailabilityComponentsMonitoringandManagement• Availabilityoftheservicesneedstobemonitored,tobeableto
takeacBonwhenthereisafailureoreventopreventthem• AfailovercanbemanualorautomaBc,butithastobemanaged
FailoverorSwitchoverSolu*on• Somemechanismtoredirecttrafficfromthefailedserveror
Datacentertoaworkingone
DataRedundancy• Forstatefulservices,weneedtomakesurethatdataismaderedundant• AvailabilitysoluBonsdonotreplacebackups
• ClusteredMariaDBnodesforsynchronousreplicaBonwithopBmisBclocking
• Fastfailover• WorkswithMariaDBMaxScale
LoadBalancingandFailover
Applica*on/AppServer
7
HighAvailability
SynchronousHAReplica*onwithMariaDBEnterpriseCluster
8
GaleraisnowinsideMariaDBEnterprise10.1■ TheMariaDBServerand
MariaDBGaleraServerpackageshavebeencombined
■ GalerapackagesandtheirdependenciesgetinstalledautomaBcally
■ TheGalerapartsremaindormantunBlconfigured,likeapluginorstorageengine
EnterprisesupportservicesfortheGaleraClusterfuncBonalityisincludedinourMariaDBEnterpriseClustersubscripBon.
TwonewInforma*onSchematablesforexaminingwsrepinformaBon,WSREP_MEMBERSHIPandWSREP_STATUShavebeenadded.MariaDBEnterpriseClusteraddsnode'sstatusandclustermembershiprelatedinformaBontotheINFORMATION_SCHEMA.ThisinformaBoncanbeusedbymonitoringsystemsandalsobyMariaDBMaxScale.
HighAvalability
9
HighAvailability• Enhancedsemi-synchronousreplicaBondoesCOMMITinthefollowingway:
a. PreparethetransacBoninthestorageengine(s)b. WritethetransacBontothebinlog,flushthebinlogtodisk.c. WaitforatleastoneslavetoacknowledgetherecepBonofthebinlog
eventsforthetransacBon.d. CommitthetransacBontothestorageengine(s)
• Standardsemi-synchronousreplicaBonwouldcommitthetransacBonbefore
itgetstheacknowlegeofthebinlogeventfromaslave
Enhancedsemi-synchronousReplica*onwithMariaDBServer10.1
MaxScalebinlogserver
10
HighAvailability§ AutomaBcdetecBonof
masterfailure§ PromoBonofaslavetoa
masterwithouttouchingotherslaves
AutomaBcFailoverwithMaxScale
Master
script 2
master_downevent
FailoverScript
4CHANGEMASTERtonew_master;
STARTSLAVE
Slaves
MaxScaleCore
3STOPSLAVE
Promoteasmaster
binlogcache
1
2
3
4
3
MaxScaleCore
11
• MaxScaleConnecBonRouBngorStatementRouBng• AlwaysRoutetoavailablenodes• SimplifiesapplicaBons• ClusterconfiguraBon,NodefailurestransparenttoapplicaBons
Minimizemaintenancedown*me
/CREATETABLE/
MySQL5.1
MariaDB10
• MaxScaleQueryTranslaBonandTeefilter• ApplicaBonandDatabasecanbeupgradedasynchronously
• ValidatefuncBonalityandperformanceonnewversionbeforemovingtoproducBon
MaxScaleCore
MaxScaleCore
s/TYPE/ENGINE/
3 4
1 5
2
12
ScalabilitytoSupportYourGrowingUserBase
ReadScaling
§ MariaDBMaster-SlaveReplicaBon
§ GlobaltransacBonID(GTID)uniqueacrossmulBpleindependentreplicaBonstreams
§ MulB-sourcereplicaBon
§ OpBmisBcParallelreplicaBon
§ SlaveexecuBonoftriggers
§ MaxScaleforloadbalancing
ImprovedeveloperproducBvitywithsimplifiedapplicaBons
Client Client Client
MaxScale
13
ScalabilitytoSupportYourGrowingUserBase
WriteScaling§ MariaDBEnterpriseCluster
§ MulB-masterreplicaBonforwriteScalability
§ MaxScaleforloadbalancing
ImprovedeveloperproducBvitywithsimplifiedapplicaBons
Client Client Client
MaxScale
ScalingBinlog
MariaDBMaxScaleBinlogServer:§ Horizontalscalingofslaveswithoutmasteroverload§ Crashsafedisasterrecovery
ScalingMul*-tenantdatabase
Slaves
BinlogCache
MasterMaxScaleMaxScale
§ MulB-tenantdatabasehosBng§ Eachtenantwithitsownschemashard§ Scalethedatabaseenvironmentasuser
baseanddatavolumegrows§ WithoutimpacBngexisBnguserbase
14
Scalability
Slaves
BinlogCache
Shard1 Shard2… Shardn
MaxScale
15
To:TrytoreplicateanytransacBoninparallel,aslongasatransacBoncanberolledbackandre-tried
■ Ifnoconflicts,parallelismimproves
■ Ifconflict,enforcedcommitorderwillcauseittobedetectedasadeadlock,andthelatertransacBonwillberolledbackandretried.
From:onlyruninparalleltransacBonsthatwereknowntobeabletosafelyreplicateinparallel.
Replication Scalability Enhancement
Op*mis*cparallelreplica*on–alltransac*onswillbeconsideredtoberuninparallel,givinganotherperformanceboostinmaster-to-slavereplica*on
16
Page Compression
■ Alternative to compress tables different (but similar) to the InnoDB COMPRESSED storage format
● InnoDB Compressed stores : both uncompressed and compressed pages in the buffer pool
● Page Compression, stores only uncompressed pages
InnoDB Defragmentation ■ Deleted records can create gaps on pages
■ No new SQL literals needed and changes to the server needed
Optimizer enhancements including EXPLAIN JSON and EXPLAIN ANALYZE (with FORMAT=JSON)
■ ANALYZE statement provides output that looks like EXPLAIN output, but also is includes data from the query execution
■ ANALYZE FORMAT=JSON produces detailed information about the statement execution
Performance
17
MariaDBEnterpriseMariaDBEnterprise:PackagedEnterpriseRDBMS1. BasedonMariaDBopensourceproject2. MariaDBMaxScale3. MariaDBConnectors4. Robusttechnicalservicesandsupport5. ProducBvitytools6. CustomerPortal7. 24x7support8. OpBonalConsulBngandRemoteDBAservices
MariaDBEnterpriseCluster▪ Advanced,mulB-masterclustering▪ ExpertsupportfordemandingproducBonapplicaBons
18
Q&A
19
ThankYou