Google云计算课程Module 7 - Other Google Technologies

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

©SpinnakerLabs,Inc.GoogleClusterComputingFacultyTrainingWorkshopModuleVII:OtherGoogleTechnologies©SpinnakerLabs,Inc.Overview•BigTable•Chubby©SpinnakerLabs,Inc.BigTable©SpinnakerLabs,Inc.AConventionalDatabase…•Datastructure:–arbitrary##ofrows–Fixednumberandtypeofcolumns•Supportssearchbasedonvaluesinallcells•Supportssynthesisofoutputreportsbasedonmultipletables(relationaloperators)©SpinnakerLabs,Inc.Google’sNeeds•Datareliability•Highspeedretrieval•Storageofhugenumbersofrecords(severalTBofdata)•(Multiple)pastversionsofrecordsshouldbeavailable©SpinnakerLabs,Inc.Assumptions•Manytimesmorereadsthanwrites•Individualcomponentfailurescommon•Disksarecheap•Iftheycontroldatabasedesignaswellasapplicationdesign,theinterfaceneednotbestandard©SpinnakerLabs,Inc.ReasonableQuestions•Arestructuredqueriesnecessary?•Candatabeorganizedsuchthatrelateddataisphysicallyclosebynature?•Whatistheminimumcoordinationrequiredtoretrievedata?•Canexistingcomponentsbeleveragedtoprovidereliabilityandabstraction?©SpinnakerLabs,Inc.FromNeedstoConstraints•Simplifieddataretrievalmechanism–(row,col,timestamp)valuelookup,only–Norelationaloperators•Atomicupdatesonlypossibleatrowlevel©SpinnakerLabs,Inc.ButSomeAdditionalFlexibility…•Arbitrarynumberofcolumnsperrow•Arbitrarydatatypeforeachcolumn–Newconstraint:datavalidationmustbeperformedbyapplicationlayer!©SpinnakerLabs,Inc.LogicalDataRepresentation•Rows&columnsidentifiedbyarbitrarystrings•Multipleversionsofa(row,col)cellcanbeaccessedthroughtimestamps–Applicationcontrolsversiontrackingpolicy•Columnsgroupedintocolumnfamilies©SpinnakerLabs,Inc.ColumnFamilies•Relatedcolumnsstoredinfixednumberoffamilies–Familynameisaprefixoncolumnname–e.g.,“fileattr:owning_group”,“fileattr:owning_user”,etc.•Permissionscanbeappliedatfamilyleveltograntread/writeaccesstodifferentapplications•Membersofafamilycompressedtogether©SpinnakerLabs,Inc.NoDataValidation•Anynumberofcolumnscanbestoredinarowwithinthepre-definedfamilies–Databasewillnotenforceexistenceofanyminimumsetofcolumns•Anytypeofdatacanbestoredinanycolumn–Bigtableseesonlybytestringsofarbitrarylength©SpinnakerLabs,Inc.Consistency•Multipleoperationsonasinglerowcanbegroupedtogetherandappliedatomically–Nomulti-rowmutationoperatorsavailable•UsercanspecifytimestamptoapplytodataorallowBigtabletouse‘now()’function©SpinnakerLabs,Inc.VersionControl•Cellversionsstoredmost-recentfirstforfasteraccesstomorerecentdata•Twoversionexpirationpoliciesavailable:–Retainlastncopies–Retaindataforntimeunits©SpinnakerLabs,Inc.DataAccess•Straight(row,col,ts)lookup•Alsosupports(row,col,MOST_RECENT)•Filterediteratorswithinrowwithregexovercolumnnamesoradditionalconstraintsontimestamps•StreamingaccessoflargeamountsofdatatoandfromMapReduce©SpinnakerLabs,Inc.Implementation•UsesseveralotherGooglecomponents:–GFSprovidesreliablelow-levelstoragefortablefiles,metadata,andlogs–Chubbyprovidesdistributedsynchronization–DesignedtoeasilyinterfacewithMapReduce©SpinnakerLabs,Inc.PhysicalDataRepresentation•SSTablefileprovidesimmutablekeyvaluemapwithanindexoverallkeysmappingkeydiskblock–IndexstoredinRAM;valuelookupinvolvesonlyonediskseektodiskblock©SpinnakerLabs,Inc.PhysicalRepresentation(2)•Alogical“table”isdividedintomultipletablets–EachtabletisoneormoreSSTablefiles•Eachtabletstoresanintervaloftablerows–Ifatabletgrowsbeyondacertainsize,itissplitintotwonewtablets©SpinnakerLabs,Inc.NetworkInterface•Onemasterserver–Communicatesonlywithtabletservers•Severaltabletservers–Performactualclientaccesses•“Chubby”lockserverprovidescoordinationandmutualexclusion•GFSserversprovideunderlyingstorage©SpinnakerLabs,Inc.BigtableArchitectureHeadnodeTabletserverGFSChunkserverSSTableSSTableSSTableTabletTabletTabletTabletserverGFSChunkserverSSTable(replica)SSTableSSTableTabletTabletTablet(replica)SSTableLogicalview:Physicallayout:SSTableChubbyServer©SpinnakerLabs,Inc.MasterResponsibilities•Determinewhichtabletservershouldholdagiven(new)tablet•InterfacewithGFStogarbagecollectstaleSSTablefiles•Detecttabletserverfailures/resumptionandloadbalanceaccordinglyTabletServerFailureTabletserverGFSChunkserverSSTableSSTableSSTableTabletTabletTabletTabletserverGFSChunkserverSSTable(replica)SSTableSSTableTabletTabletTablet(replica)SSTableLogicalview:Physicallayout:SSTableChubbyServerHeadnodeTabletServerFailureChubbyServerTabletserverGFSChunkserverSSTableSSTableSSTableTabletTabletTabletTabletserverGFSChunkserverSSTable(replica)SSTableSSTableTabletTabletTablet(replica)SSTableLogicalview:Physicallayout:SSTableXXXXXHeadnodeTabletServerFailureTabletserverGFSChunkserverSSTableSSTableSSTableTabletTabletTablet(replica)SSTableLogicalview:Physicallayout:Tablet(othertabletserversdraftedtoserveother“abandoned”tablets)BackupcopyoftabletmadeprimaryMessagesenttotabletserverbyheadnodeExtrareplicaoftabletcreatedautomaticallybyGFSChubbyServerHeadnodeTableAccessStructure©SpinnakerLabs,Inc.WriteProcedure•WritestoatabletarerecordedinaGFS-enabledcommitlog•Newdataisthenstoredinmemoryontabletserver–supercedesunderlyingSSTablefiles©SpinnakerLabs,Inc.MinorCompactions•Olddata

1 / 68
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功