《如何选择适用企业的NoSQL解决方案》

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

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

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

资源描述

CompareCloudNoSqlSolutionMingLeiManyNoSqlSolutionsoutthere:1.ConceptsofDistributedProgrammingArchitecture.2.ApplicationProgrammingModel.3.DetailedComparisonofafewNoSqlopen-sourceprojectsCassandraHbaseMongoDBMemCacheCommonArchitecturesHighlyCoupled(clustered):referstypicallytoaclusterofmachinesthatcloselyworktogether,runningasharedprocessinparallel.Thetaskissubdividedinpartsthataremadeindividuallybyeachoneandthenputbacktogethertomakethefinalresult.SpaceBased(virtualsingleaddressspace)referstoaninfrastructurethatcreatestheillusion(virtualization)ofonesingleaddress-space.Dataaretransparentlyreplicatedaccordingtoapplicationneeds.Decouplingintime,spaceandreferenceisachieved.CommonArchitecture(2)Peer-to-Peervs.Client-to-ServerNospecialmachineormachinesthatprovideaserviceormanagethenetworkresources.Insteadallresponsibilitiesareuniformlydividedamongallmachines,knownaspeers.vs.Machinesareassigneddifferenttasksandresponsibilitiesinacluster.Theydependoneachotherasclienttoserver.CommonArchitecture(3)Inter-processCo-ordinationvs.DatabaseCentricMethodofcommunicatingandcoordinatingworkamongconcurrentprocessesondifferentmachines.vs.Enabledistributedcomputingtobedonewithoutanyformofdirectinter-processcommunication,byutilizingashareddatabaseComparisonMetricsStorageTypeCAPACIDRead/WritePerformanceReplicationandShardingIndexedQueryandSecondaryIndexHighAvailability,FaultTolerance,FailoverScalabilityondataandrequestStorageTypesDocument:Jackrabbit,MongoDb,ArangoDb,CouchBase,CouchDbColumns:Hbase,CassandraKey-Values:Riak,MemCacheDbCAPTheoremConsistencydataisthesameacrossreplicationsAvailabilityabilitytoaccesstheclusterevenifanodeintheclustergoesdownPartitionToleranceclustercontinuestofunctionevenifthereisapartition(communicationsbreak)betweennodesCAPTheoremAdistributedsystemcannotsatisfyallthree.CAdataisconsistentbetweenallnodesbutmaybecomeoutofsyncifthereispartitionincluster.CPdataisconsistentbetweenallnodes,andmaintainspartitiontolerancebybecomingunavailablewhenanodegoesdown.APnodesremainonlineandunsyncedduringapartitionCAPandEventualConsistencyEventualConsistency––Datamaybetemporarilyoutofsyncondifferentnodesandwilleventuallybebroughttothesameversion.Canbeimplementedwithabackgroundprocessthatupdatesout-of-syncnodes.AdistributedsystemcanbeeCAP–ThisishowmanynoSqlstoresworks.Clustering:Sharding/ReplicationSharding–distributesasinglelogicaldatabasesystemacrossaclusterofmachines.Replication–replicatesdataamongagroupofmachineswithinaclustertoensureredundancy,backup,andautomaticfailover.Master-masterMaster-slaveACIDAtomic.Everythinginatransactionsucceedsortheentiretransactionisrolledback.Consistent.Atransactioncannotleavethedatabaseinaninconsistentstate.Isolated.Transactionscannotinterferewitheachother.Durable.Completedtransactionspersistintheeventofcrashesorserverfailure.TheScopeofACIDTraditionalSQL:ACIDforthewholedatabaseacrossalltables.CloudbasedLightweightSQL:LogicallypartitiondataandsupportACIDwithinalogicalpartition.E.g.,–WebsitehostingservicepartitiondatabydifferentwebsiteNoSql:partialACIDorACIDatrowlevel,(eg,HBase)MemCache“Free&opensource,high-performance,distributedmemoryobjectcachingsystem,genericinnature,butintendedforuseinspeedingupdynamicwebapplicationsbyalleviatingdatabaseload.Memcachedisanin-memorykey-valuestoreforsmallchunksofarbitrarydata(strings,objects)fromresultsofdatabasecalls,APIcalls,orpagerendering.“MemCache–ArchitectureShardinginclientcodetoselectserver.Peer-to-PeerServerinstances.Serverusesin-memstorage.Potentiallyexpandtopersistentstore.MemCache–UsageCharacteristicsObject-levelConsistency,IsolationandAtomicity.NopersistentstorageNoreplicationforload-balancingorfailoverConsistency+Partition-toleranceinCAPMongoDbDocument-oriented.ThinkofMySQLbutwithJSON-likeobjectscomprisingthedatamodel,ratherthanRDBMStables.Supportsneitherjoinsnortransactions.secondaryindexesatomicwritesonaper-documentlevel,andfully-consistentreads.master-slavereplicationwithautomatedfailoverandbuilt-inhorizontalscalingviaautomatedrange-basedpartitioning.MongoDb–DocumentModelCollection:collectionofdocumentofthesametype.Document:asetofname-valuepairs(properties)FlexibleanddynamicschemaofdocumentsSecondaryindexescanbebuiltondocumentproperties.Usage:mapobjects/relationaltablestoMongoDbdocuments.MongoDb–ACIDandCAPDocumentlevelAIDDataConsistency–tunablebetweenreadconsistencyandhighavailability/performanceReadscanbeconsistentoreventuallyconsistentToachievecompleteconsistency,writehastooccuronallreplicassynchronously.CAofCAPoreCAPMongoDb–ShardingShardbykeyofdocumentpropertieswithinacollection.Centralmappingfromkeyspacetoshards.Clientrequestsaredirectedtodifferentshardbyservicemongos.Dynamicbalancingofshards.MongoDb–ReplicationPrimaryNodeandSecondaryNodes.Synch/AsyncpropagationofwritesfromPrimarytoSecondaries.Re-electaprimaryamongsecondarieswhenprimarygoesdown.Roll-backofwriteswhenaformerprimaryrejoinsasasecondaryRoll-backwritesnotpropagated.Humaninterventionisneeded.MongoDb–Read/W

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

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

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

×
保存成功