cap theorem technologies for scalable distribu8on
play

CAP Theorem Technologies for Scalable Distribu8on - PowerPoint PPT Presentation

CAP Theorem Technologies for Scalable Distribu8on CS4230 Jay Urbain, Ph.D. Credits: Dynamo: Amazons Highly Available Key-value Store ,


  1. CAP ¡Theorem ¡ Technologies ¡for ¡Scalable ¡ Distribu8on ¡ ¡ CS4230 ¡ Jay ¡Urbain, ¡Ph.D. ¡ Credits: ¡ “ Dynamo: ¡Amazon’s ¡Highly ¡Available ¡Key-­‑value ¡Store ,” ¡ ¡ ¡ Giuseppe ¡DeCandia, ¡Deniz ¡Hastorun, ¡Madan ¡Jampani, ¡ Gunavardhan ¡Kakulapa8, ¡Avinash ¡Lakshman, ¡Alex ¡Pilchin, ¡ Swaminathan ¡Sivasubramanian, ¡Peter ¡Vosshall ¡and ¡Werner ¡ Vogels. ¡

  2. Willet ¡

  3. Graphic ¡thanks ¡to ¡ Migra8ng ¡Your ¡Applica8ons ¡and ¡Processes ¡to ¡the ¡Cloud: ¡Prac8cal ¡Checklist ¡

  4. Topics ¡ • Technologies ¡for ¡Scalable ¡Distribu8on ¡ – Cap ¡Theorem ¡ ¡ – Consistent ¡Hashing ¡ – Vector ¡Clocks ¡ – Sloppy ¡Quorum ¡ – Merkle ¡Hash ¡Trees ¡ • Dynamo: ¡Amazon’s ¡Highly ¡Available ¡ Key-­‑value ¡Store ¡

  5. How ¡much ¡data ¡is ¡a ¡lot? ¡ 640K ¡ought ¡to ¡be ¡ enough ¡for ¡anybody. ¡

  6. How ¡much ¡data? ¡ Google ¡indexes ¡60 ¡trillion ¡web ¡pages ¡(2016). ¡ • It ¡takes ¡over ¡100 ¡petabytes ¡(equivalent ¡to ¡100,000 ¡1TB ¡hard ¡drives) ¡to ¡store ¡it ¡ • all. ¡For ¡comparison ¡Google’s ¡web ¡index ¡was ¡1 ¡trillion ¡pages ¡in ¡2008 ¡and ¡in ¡2000 ¡ it ¡was ¡a ¡meager ¡1 ¡billion. ¡ Google ¡also ¡indexes ¡private ¡data ¡like ¡email, ¡photos, ¡docs, ¡etc. ¡The ¡private ¡index ¡ • is ¡somewhat ¡more ¡recent ¡but ¡has ¡been ¡growing ¡rapidly ¡along ¡with ¡the ¡web ¡ index. ¡ – haps://www.google.com/insidesearch/howsearchworks/crawling-­‑ indexing.html ¡ Facebook ¡has ¡a ¡500+ ¡Peta ¡byte ¡data ¡warehouse, ¡and ¡processes ¡>500 ¡TB ¡of ¡new ¡ • data ¡daily ¡(2014) ¡ – hap://www.adweek.com/social8mes/orcfile/434041 ¡ Wayback ¡Machine ¡has ¡~9 ¡PB ¡+ ¡20 ¡TB/week(3/December ¡2014) ¡ • CERN’s ¡LHC: ¡100 ¡PB ¡a ¡year ¡(2015) ¡ • Large ¡Synop8c ¡Survey ¡Telescope ¡(LSST): ¡6-­‑10 ¡PB ¡a ¡year ¡(~2015) ¡ • ¡ A ¡petabyte ¡(PB) ¡is ¡10 15 ¡bytes ¡of ¡data, ¡1,000 ¡terabytes ¡(TB) ¡or ¡1,000,000 ¡gigabytes ¡ (GB). ¡ ¡

  7. Consistency ¡Models ¡in ¡Rela8onal ¡ DBMS ¡ • RDBMS ¡transac8ons ¡are ¡typically ¡described ¡as ¡“ACID” ¡ transac8ons. ¡ ¡ ¡ – Atomic: ¡The ¡transac8on ¡is ¡indivisible ¡– ¡either ¡all ¡the ¡ statements ¡in ¡the ¡transac8on ¡are ¡applied ¡to ¡the ¡database, ¡ or ¡none ¡are. ¡ – Consistent: ¡The ¡database ¡remains ¡in ¡a ¡consistent ¡state ¡ before ¡and ¡amer ¡transac8on ¡execu8on. ¡ – Isolated: ¡While ¡mul8ple ¡transac8ons ¡can ¡be ¡executed ¡by ¡ one ¡or ¡more ¡users ¡simultaneously, ¡one ¡transac8on ¡should ¡ not ¡see ¡the ¡effects ¡of ¡other ¡concurrent ¡transac8ons. ¡ – Durable: ¡Once ¡a ¡transac8on ¡is ¡commiaed, ¡its ¡changes ¡are ¡ expected ¡to ¡persist. ¡

  8. Consistency ¡Models ¡in ¡Non-­‑rela8onal ¡ DBMS ¡ • One ¡of ¡the ¡most ¡significant ¡differences ¡between ¡the ¡new ¡ genera8on ¡of ¡non-­‑rela8onal ¡( NoSQL ) ¡databases ¡and ¡ tradi8onal ¡RDBMS ¡is ¡the ¡way ¡in ¡which ¡ consistency ¡of ¡data ¡is ¡ handled. ¡ ¡ ¡ • In ¡a ¡tradi8onal ¡RDBMS, ¡ all ¡users ¡see ¡a ¡consistent ¡view ¡of ¡the ¡ data. ¡ ¡ ¡ • Once ¡a ¡user ¡commits ¡a ¡transac8on, ¡all ¡subsequent ¡queries ¡ will ¡report ¡ that ¡ transacFon ¡and ¡no-­‑one ¡will ¡“see” ¡par8al ¡ results ¡of ¡a ¡transac8on. ¡( Note: ¡dependent ¡on ¡the ¡isolaFon ¡ level). ¡

  9. Eventual ¡Consistency ¡ • A ¡compromise ¡between ¡consistency ¡and ¡weak ¡(no ¡ guarantees) ¡consistency ¡is ¡ Eventual ¡Consistency . ¡ • Eventual ¡consistency: ¡database ¡may ¡have ¡some ¡ inconsistencies ¡at ¡a ¡point ¡in ¡8me, ¡but ¡it ¡will ¡eventually ¡ become ¡consistent ¡should ¡all ¡updates ¡cease. ¡ ¡ ¡ – I.e., ¡ ¡inconsistencies ¡are ¡transitory: ¡ ¡eventually ¡all ¡nodes ¡ will ¡receive ¡the ¡latest ¡consistent ¡updates. ¡

  10. Remembrance ¡Inc. ¡– ¡Ch. ¡1 ¡ Credits: ¡Kaushik ¡Sathupadi ¡ hap://ksat.me/a-­‑plain-­‑english-­‑introduc8on-­‑to-­‑cap-­‑theorem/ ¡ ¡ Remembrance ¡Inc! ¡ -­‑ ¡Never ¡forget, ¡ ¡even ¡without ¡remembering! ¡ ¡ ¡ ¡Ever ¡felt ¡bad ¡that ¡you ¡forget ¡so ¡much? ¡ ¡Don't ¡worry. ¡Help ¡is ¡just ¡a ¡phone ¡ away! ¡ ¡ ¡ ¡ ¡When ¡you ¡need ¡to ¡remember ¡something, ¡just ¡call ¡ 555-­‑55-­‑REMEM ¡ and ¡tell ¡ us ¡what ¡you ¡need ¡to ¡remember. ¡For ¡e.g., ¡call ¡us ¡and ¡let ¡us ¡know ¡of ¡your ¡ boss's ¡phone ¡number, ¡and ¡forget ¡to ¡remember ¡it. ¡when ¡you ¡need ¡to ¡know ¡it ¡ back. ¡Call ¡back ¡the ¡same ¡number[(555)-­‑-­‑55-­‑REMEM ¡] ¡and ¡we'll ¡tell ¡you ¡what's ¡ your ¡boss's ¡phone ¡number. ¡ ¡ ¡ ¡Charges ¡: ¡only ¡$0.10 ¡per ¡request ¡

  11. Ch. ¡2 ¡: ¡You ¡scale ¡up ¡ Your ¡venture ¡gets ¡funded ¡by ¡ YCombinator . ¡Your ¡idea ¡is ¡so ¡simple, ¡needs ¡nothing ¡ but ¡a ¡ paper ¡notebook ¡and ¡phone , ¡yet ¡so ¡effec8ve ¡that ¡it ¡spreads ¡like ¡wild ¡fire. ¡ You ¡ start ¡ge@ng ¡hundreds ¡ of ¡call ¡every ¡day. ¡ ¡ You ¡see ¡ that ¡more ¡and ¡more ¡of ¡your ¡customers ¡have ¡to ¡wait ¡in ¡the ¡queue ¡to ¡ speak ¡to ¡you . ¡Most ¡of ¡them ¡even ¡hang ¡up, ¡8red ¡of ¡the ¡wai8ng. ¡Besides ¡when ¡ you ¡were ¡sick ¡the ¡other ¡day ¡and ¡could ¡not ¡come ¡to ¡work ¡you ¡lost ¡a ¡whole ¡day ¡of ¡ business. ¡Not ¡to ¡men8on ¡all ¡those ¡dissa8sfied ¡customers ¡who ¡wanted ¡ informa8on ¡on ¡that ¡day. ¡ You ¡decide ¡it’s ¡Fme ¡for ¡you ¡to ¡scale ¡your ¡service ¡and ¡bring ¡in ¡your ¡wife ¡to ¡help ¡ you. ¡ ¡ Your ¡start ¡with ¡a ¡simple ¡plan: ¡ You ¡and ¡your ¡wife ¡both ¡get ¡an ¡extension ¡phone ¡ • Customers ¡s8ll ¡dial ¡(555)–55-­‑REMEM ¡and ¡need ¡to ¡remember ¡only ¡one ¡ • number ¡ A ¡PBX ¡will ¡route ¡the ¡a ¡customers ¡call ¡to ¡whoever ¡is ¡free ¡ •

  12. Ch. ¡3 ¡: ¡“Bad ¡Service” ¡ ¡ Two ¡days ¡amer ¡you ¡implemented ¡the ¡new ¡system, ¡you ¡get ¡a ¡call ¡from ¡your ¡trusted ¡customer ¡ John. ¡This ¡is ¡how ¡it ¡goes: ¡ ¡ John: ¡Hey ¡ You: ¡Glad ¡you ¡called ¡“Remembrance ¡Inc!”. ¡What ¡can ¡I ¡do ¡for ¡you? ¡ John: ¡Can ¡you ¡tell ¡me ¡when ¡is ¡my ¡flight ¡to ¡Boston? ¡ You: ¡Sure.. ¡1 ¡sec ¡sir ¡ (You ¡look ¡up ¡your ¡notebook, ¡wow! ¡there ¡is ¡no ¡entry ¡for ¡“flight ¡date” ¡in ¡John’s ¡page)!!!!! ¡ You: ¡Sir, ¡I ¡think ¡there ¡is ¡a ¡mistake. ¡You ¡never ¡told ¡us ¡about ¡your ¡flight ¡to ¡Boston ¡ John: ¡What! ¡I ¡just ¡called ¡you ¡guys ¡yesterday! ¡(cuts ¡the ¡call!) ¡ ¡ How ¡did ¡that ¡happen? ¡Could ¡John ¡be ¡lying? ¡You ¡think ¡about ¡it ¡for ¡a ¡second ¡and ¡the ¡reason ¡hits ¡ you! ¡Could ¡John’s ¡call ¡yesterday ¡reached ¡your ¡wife? ¡You ¡go ¡to ¡your ¡wife’s ¡desk ¡and ¡check ¡her ¡ notebook. ¡Sure ¡enough ¡it’s ¡in ¡there. ¡You ¡tell ¡this ¡to ¡your ¡wife ¡and ¡she ¡realizes ¡the ¡problem ¡too. ¡ ¡ What ¡a ¡terrible ¡flaw ¡in ¡your ¡distributed ¡design! ¡ Your ¡distributed ¡system ¡is ¡not ¡consistent! ¡ There ¡ could ¡always ¡be ¡a ¡chance ¡that ¡a ¡customer ¡updates ¡something ¡which ¡goes ¡to ¡either ¡you ¡or ¡your ¡ wife, ¡and ¡when ¡the ¡next ¡call ¡from ¡the ¡customer ¡is ¡routed ¡to ¡another ¡person ¡there ¡will ¡not ¡be ¡a ¡ consistent ¡reply ¡from ¡Remembrance ¡Inc! ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend