MariaDB10.0&What’sNewwithTheProjectMichael“Monty”WideniusColinCharlesWhoarewe•Michael“Monty”Widenius–CreatorofMySQL–ProjectleaderatMariaDB,founderofMontyProgramAb–CTO,MariaDBFoundation–monty@mariadb.org|twitter:@montywi•ColinCharles–ChiefEvangelist,MariaDB@MontyProgramAb(soonSkySQL)–FormerlyofMySQL–colin@mariadb.org|twitter:@bytebot2Agenda•MariaDB10.0seriesintroduction•WherewestandtowardsMySQL5.6•Features,includingMariaDBGaleraCluster3What’sMariaDB?•38months:majorreleases(5.1,5.2,5.3,5.5,GaleraCluster)and10.0series•Stillcommunitydeveloped,featureenhanced&backwardcompatible•maria-captains:50%MP,50%communityincludingSphinxsearch,SkySQL,Taobao,Percona,Codership,Facebook,&more...•GPLv2server4Goalhasn’tchanged•uninstallmysql-server•installmariadb-server•itshould“justwork!”(&becompatible)•(ormorerecently,youjustapt-get/yuminstallmariadb,anditremovesmysql)•MySQLcompatible:–dataondisk&onthewireissame–samefilenames,sockets,port5WhyMariaDB10.0?•The5.5mergetookaboutayear(!)•InMariaDB5.5,wehaveover1.5millionlinesofextracode~61MBdiff•MySQL5.6refactoredwithhugelossesincommithistory•We’renotapatchsetagainstMySQL–MariaDBclearlydoesnotdependonMySQLforfuturedevelopment6MariaDB10.0:Inanutshell...•BuiltonMariaDB5.5•BackportedfeaturesfromMySQL5.6•Multiplenewfeatures7First,let’sstartwithsomehistory•MariaDB5.1(MySQL-5.1base)–Tableelimination,newstorageengines,cleanup,bettertests,poolofthreads•MariaDB5.2(MariaDB-5.1base)–Virtualcolumns,extendeduserstatistics,segmentedMyISAMkeycache•MariaDB5.3(MariaDB-5.2base)–Biggestchangestooptimizer(fastersubqueries,joins,etc.)–Microsecondprecision,fasterHANDLER(HANDLERRED50%fasterw/530,000qps),dynamiccolumns–Betterreplication(groupcommit,etc.)–HandlerSocket8MariaDB5.5(MariaDB5.3+MySQL5.5)•Opensource,moreefficientthreadpool•Non-blockingclientlibrary•NewLIMITROWSEXAMINEDoption•ExtendedkeysforXtraDB/InnoDB•NewSphinxSE•Lotsofsecurityfixes,newstatusvariables,etc.9MariaDB10.010DateVersionStatus12Nov201210.0.0Alpha6Feb201310.0.1Alpha24Apr201310.0.2Alpha10.0.3BetaBackportedfeatures•InnoDBincludingTRANSACTIONREADONLY•PERFORMANCE_SCHEMA•OnlineALTERTABLE(in-progress)•Optimizer–ORDERBY...LIMIToptimization(showsonlyfewrowsofaresultset)•Re-implemented:–Errormessages(w/systemerrorstring)–CURRENT_TIMESTAMPasDEFAULTforDATETIMEcolumns–GlobalTransactionID(10.0.2-MDEV-26)–Parallelreplication•New(optimizer)–EXISTS-TO-INoptimization11OnlyinMariaDB10.0:Multi-sourcereplication•WorkfromTaobao•Manyuserspartitiondataacrossmanymasters...nowyoucanreplicatemanymasterstoasingleslave•Greatforanalyticalqueries,completebackups,etc.12OnlyinMariaDB10.0:•SHOWEXPLAINforthread_idgetsthequeryplanforarunningstatement•FasterALTERTABLEwithuniquekeysforAria&MyISAM•Per-threadmemoryusage(Taobao)–INFORMATION_SCHEMA.PROCESSLISThasMEMORY_USAGE&EXAMINED_ROWSnow–SHOWSTATUShasmemoryusagetoo13OnlyinMariaDB10.0:CassandraSE,LevelDBsupport•MariaDBasa“dataplatform”•IntegrationwithNoSQL/BigDataDB,ApacheCassandracluster,seenasastorageenginetoMariaDB•Combine(join)databetweenCassandra&MariaDB&Oracle(viaCONNECT)•WritetoCassandrafromSQL(SELECT,INSERT,UPDATE,DELETE)•LevelDB(in-progress)14OnlyinMariaDB10.0:Engineindependentpersistentstatistics•InnoDBhaspersistentstatisticsinMySQL5.6;wehaveanengine-independentversion•Thesestatisticsaren’tlimitedbytheSEAPI,andareusedbyqueryoptimizertochoosebestexecutionplanforeachstatement•Statisticscollectedfornon-indexedcolumnstoo(unlikeInnoDB’s)15Dynamiccolumns•Storeadifferentsetofcolumnsforeveryrowinthetable(kindaNoSQL-like)•Databaseinteroperabilityisnowamajorfeature;CassandraSEmakesusesofthis•CannowrequestarowinJSONformat•Andyes,youcannamecolumnsfinally;)16SegmentedMyISAMkeycache•SolvesmajorreadbottlenecksforMyISAM•MyISAMusagewithmanyreaders17BKAspeedupsselectmax(l_extendedprice)fromorders,lineitemwhereo_orderdatebetween$DATE1and$DATE2andl_orderkey=o_orderkey18Groupcommitinthebinarylog19Source:MarkCallaghan,=10150261692455933Groupcommitevenfasterin10.0•Slowfsync(removingcheckpointpercommitsaving1-in-3fsyncs)•Fastfsync(reducedstallonLOCK_loggivesspeedup)20Groupcommitbenchmarkagainst5.6•MySQL5.6removescheckpointpercommit•Morecomplexthreadscheduling,lessgroupingofcommits•DoesnotremovestallonLOCK_log,lessgroupingofcommits21Threadpool5.5vs5.122MariaDB10.0.2•SupportforatomicwritesonFusionIODirectFS•Optimizercollects&canusehistogram-basedstatisticsfornon-indexedcolumns•Bettertablediscovery,soFederatedXhasassisteddiscovery,Sequenceengine(createsascending/descendingsequences,usefulinjoins)23Roadmap•MariaDBisalreadyasupersetoffeaturesinMySQL•Mergeisin2steps–10.0.x–10.1.x•PlanistohaveallimportantfeaturesofMySQL5.6bythetimeMariaDB10.1.xisreleasedasstable–ForallpracticalpurposesMariaDB10.1.xwillbeadropinreplacementtoMySQL5.624LGPLclientlibraries•LGPLclientlibrariesforC&Java•WorkswithMariaDB/MySQL/PerconaServer•DevelopedbyMontyProgramAb&SkySQLAb,releasedasLGPL29Nov2012•ODBCisintheworks,sponsorsarewelcome!25MariaDBGaleraCluster•MariaDBGaleraClusterismadefortoday’scloudbasedenvironments.Itisfullyre