pros and cons of nosql databases - ut · pros and cons of nosql databases ... a co‐relaonal model...

28
Pros and Cons of NoSQL Databases Based on papers by Christof Strauch and by Erik Meijer, Gavin Bierman PresentaBon by Kristjan Kool SoEware Engineering Seminar, 11.11.2011

Upload: vuduong

Post on 09-Sep-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

ProsandConsofNoSQLDatabasesBasedonpapersbyChristofStrauchandbyErik

Meijer,GavinBierman

PresentaBonbyKristjanKoolSoEwareEngineeringSeminar,11.11.2011

Page 2: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

Outline

Ipart„NoSQLdatabase“byChristofStrauch

•  Mo#vesandMainDrivers•  Cri#cism

IIpartAco‐RelaBonalModelofDataforLargeSharedDataBanksbyErikMeijerandGavinBierman

•  Abouteconomicalbarriersandpossibilites

Page 3: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

IntroducBon:NoSQL

“thewholepointofseekingalternaBvesisthatyouneedtosolveaproblemthatrelaBonaldatabasesareabadfitfor”

EricEvans,reintroducerofthetermNoSQLinearly2009

Page 4: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

IntroducBon:NoSQL

„NextGeneraBonDatabasesmostlyaddressingsomeofthepoints:beingnon‐relaBonal,distributed,open‐sourceand

horizontallyscalable“

NoSQLdefiniBon@hZp://nosql‐database.org/

Page 5: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

IntroducBon:NoSQL

ClassificaBonofNoSQL(accordingtopaper)

•  key/valuestores,•  documentdatabases,

•  andcolumn‐orienteddatabases.

Page 6: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

IntroducBon:NoSQL

Source:NathanHurst’sblogpost

Page 7: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

MoBvesandMainDrivers

•  AvoidanceofUnneededComplexity– SomeBmesBASE(BasicallyAvailable,SoEstate,Eventualconsistency)isgoodenough

•  AvoidanceofExpensiveObject‐RelaBonalMapping– MostoftheNoSQLdatabasesaredesignedtostoredatastructuresthatareeithersimpleormoresimilartotheonesofobject‐orientedprogramminglanguagescomparedtorelaBonaldatastructures.

Page 8: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

MoBvesandMainDrivers

•  HorizontalScalabilityandRunningonCommodityHardware

•  DecreasedComplexityandCostofSebngupDatabaseClusters– PCclusterscanbeeasilyandcheaplyexpandedwithoutthecomplexityandcostof’sharding,’whichinvolvescubngupdatabasesintomulBpletablestorunonlargeclustersorgrids.

Page 9: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

MoBvesandMainDrivers

•  CompromisingReliabilityforBeZerPerformance

•  TheCurrent“Onesizefit’sitall”DatabasesThinkingWasandIsWrong–  TheconBnuousgrowthofdatavolumes(tobestored)

–  ThegrowingneedtoprocesslargeramountsofdatainshorterBme

•  TheMythofEffortlessDistribuBonandParBBoningofCentralizedDataModels

Page 10: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

MoBvesandMainDrivers

•  MovementsinProgrammingLanguagesandDevelopmentFrameworks–  TheNoSQLdatabasesreactonthistrendandtrytoprovidedatastructuresintheirAPIsthatareclosertotheonesofprogramminglanguages(e.g.key/value‐structures,documents,graphs).

•  RequirementsofCloudCompuBng•  TheRDBMSplusCaching‐LayerPaZern/Workaroundvs.SystemsBuiltfromScratchwithScalabilityinMind

Page 11: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

MoBvesandMainDrivers

•  Yesterday’svs.Today’sNeeds–  PolyglotPersistence– we’removingtowardsapluralisBcapproachtostoringourdata•  Scalability•  Highavailability•  Faulttolerance•  Distributability•  Flexibility(i.e."schemaless"databases)•  NewtypesofapplicaBonslikesocialnetworkingwebsites

Page 12: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

MainDrivers

Source:The451GroupblogarBcle

Google

Amazone

Facebook

LinkedIn

exisBngdatabaseproductsand

vendorswerenotsuitabletomeetrequirementsof

Web2.0companies

Page 13: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

CriBcism

•  ScepBcismontheBusinessSide– Support(SLA,quaranBes)– nobodytoblameforFailures

•  NoSQLasaHype– movementseemslackingthefulfillmentofitspromises

Page 14: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

CriBcism

•  NoSQLasBeingNothingNew– Similardatabaseshavebeenaroundfordecades(LotusNotes,Object‐orientedDB‐s,Berkleyetc)

•  NoSQLMeantasaTotal“NotoSQL”–  irritaBonaboutthetermanditsfirstnoBonasatotalneglectofrelaBonaldatabaseshasleadtomanyprovokingstatements

Page 15: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

CriBcism

•  RequirementsofAdministratorsandOperators– hugedifferencesamongtheNoSQLdatabases

•  Performancevs.Scalability– YoushouldusefornewapplicaBonsthetoolfibngthejobbest

– ACIDversBASE– non‐relaBonaldatabases—justlikerelaBonalones—areno“onesizefitsall”soluBonseither.

Page 16: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

CriBcism

•  „NoSQLisjustaboutscalabilityand/orperformance.”

•  “NoSQLisjustdocumentdatabases,orkey‐valuestores,or...”

•  “IcandoNoSQLjustaswellinarelaBonaldatabase.”

•  “NoSQLisawholesalerejecBonofrelaBonaldatabases.”

Page 17: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

IIpart‐economicsituaBon

ThecurrentNoSQLmarketsaBsfiesthethreecharacterisBcsofamonopolisBcallycompeBBvemarket:

•  thebarrierstoentryandexitarelow;•  therearemanysmallsuppliers;

•  andthesesuppliersproducetechnicallyheterogeneous,highlydifferenBatedproducts.

Page 18: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

economicsituaBon

•  MonopolisBcallycompeBBvemarketsareinconsistentwiththecondiBonsforperfectcompeBBon.

•  HenceinthelongrunmonopolisBcallycompeBBvefirmswillmakezeroeconomicprofit.

Page 19: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

economicsituaBon

•  Today,therelaBonaldatabasemarketisaclassicexampleofanoligopoly.

•  Themarkethasafewlargeplayers(Oracle,IBM,MicrosoE,MySQL)

•  thebarrierstoentryarehigh,andallexisBngSQL‐basedrelaBonaldatabaseproductsarelargelyindisBnguishable.

•  Oligopoliescanretainhighprofitsinthelongrun;todaythedatabaseindustryisworthanesBmated$32billionandsBllgrowinginthedoubledigits.

Page 20: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

Howtoovercomethebarriers?

•  JustasCodd’sdiscoveryofrelaBonalalgebraasaformalbasisforSQLshiEedthedatabaseindustryfromamonopolisBcallycompeBBvemarkettoanoligopoly

Page 21: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

SoluBon?

•  commonabstractmathemaBcaldatamodelandanassociatedquerylanguageforNoSQLthatremovesproductdifferenBaBonatthelogicallevel.

•  Theavailabilityofsuchbasiscanprovideenoughcri#calmasstoconvincebusinesses,developers,educa#onalins#tu#ons,etc.toinvestinNoSQL.

Page 22: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

Dowebeliveit?

Fact:(some)vendorsneedtomakeprofit!?

•  opensourcevers.closedsource?•  consolidaBonofthevendors(ongoing)?•  Intra‐corporateneedsversuspublicneeds?•  AdapBon(withDBMS)?•  Standards?•  etc

Page 23: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

HowtoreallyovercomeOligopoly?

Perhapsit’sjustanormalprocess:

Source:HypecyclefromWikipedia

Page 24: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

FurtherRecommendedReadings

•  MichaelStonebrakerarBcles:–  “OneSizeFitsAll”:AnIdeaWhoseTimeHasComeandGone“

–  TheEndofanArchitecturalEra(It’sTimeforaCompleteRewrite)

–  SQLDatabasesv.NoSQLDatabases–  NoSQLandEnterprises

•  StefanEdlich(authoroftheworldfirstNoSQLbook)–  hZp://nosql‐database.org/

•  MyNoSQLbyAlexPopescu

•  NoSQLtapesprojectbyTimAnglade

•  NoSQLintheEnterprisebySouravMazumder

Page 25: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

ThankYouPs!It’sgoingtobeavictoriousevening

Page 26: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

Post‐presentaBonQuataBons

“Thosewhodonotunderstandthelessonsfrompreviousgenera=onsystemsaredoomedtorepeattheirmistakes.”Inotherwords,“Standontheshouldersofthosewhocamebeforeyou,notontheirtoes.”

M.Stonebraker,„NoSQLandenterprises“

Page 27: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

Post‐presentaBonQuataBons„Considerahouseholdanalogy:if,asyoubuildahouse,yourunwiringinconduit,externaltoyourwalls,andsurface‐mountyourfixtures,you’llalwaysbeabletoupgradeyourwiring,orrepairawiring

segmentgonebad.Butifyouknowthattheelectrical,andmaybecableTVandcomputernetworkwiringtobeinstalledwillsuityourpurposesforthelongterm,thenitmakesperfectsensetorunyourwiringin‐wall.Youcanalwaysopenthewallsagainifneedbe,andifyou’rereasonablycertainthatyouwon’tneedto,thenrunningthe

wiringinternallyistherightdecision.ItwilllookbeMertomostpeople,makeiteasiertopushfurnitureagainstthewallandwill,arguably,besomewhatsafer.Ingeneral,yourhomewillhaveamorefinishedlooktoit.Ifonedayyourneedschangeandyouneedtoopenthewallsagain,thatwillnotnecessarilymeanyoumadeabaddecision.„

AndrewJ.Brust,„NoSQLandtheWindowsAzureplarorm“

Page 28: Pros and Cons of NoSQL Databases - ut · Pros and Cons of NoSQL Databases ... A co‐Relaonal Model of Data for Large Shared Data Banks ... • The RDBMS plus Caching‐Layer Paern

Post‐presentaBonQuataBons

„NoSQLIsfortheBirds„

BenjaminBlack