SlideShare a Scribd company logo
Petabytes and Nanoseconds 
Distributed Data Storage andthe CAP Theorem 
FIN talk 
Robert Greiner 
Nathan Murray 
August 21,2014
CHAPTER 
The Problems 
Your phone can add two numbers in the same time it takes light to travel one foot 
All high frequency trading servers are connected to the NASDAQ network with the same length of cable, so that no party has a speed advantage
A Common Scenario 
Web 
Application 
RDBMS 
+ =
The Solution: Scale All the Things!!1
Why shouldwe scale? 
Throughput 
Latency 
Storage 
Reliability
The Solution? 
Add a load balancer 
Add more web servers 
Tune the DB. Indexes,SPs, etc.
There’sa new bottleneck 
Generally an RDBMS can becomea bottleneck around 10K transactions per second
Next Step… Distribute Your Data 
Each web server can talk to any data storage node 
Nodes distribute queries and replicate data – lots more complexity!
Cluster = Additional Complexity
Enter the CAP Theorem! 
This guy created the CAP Theorem 
This guy’s 
VP Invented the internet
CAP Theorem: Defined 
Within a distributed system, you can only make two of the following three guarantees across a write/read pair
Guarantee 1: Consistency 
If a value is written, and then fetched, I will alwaysget back the new value 
Note: not the same as the C in ACID! 
_
Guarantee 2: Availability 
If a value is written, a success message should always be returned. If a subsequent read returns a stale value, or something reasonable, it’s OK. 
_ 
Note: not the same as the A in HA!
Guarantee 3: Partition Tolerance 
The system will continue to function when network partitions occur –OOP != NP. 
_ 
Note: nothing to do with BAC!
CAP Triangle 
The CAP Theorem is explained as a triangle 
C, A or P: Pick two 
This is true in practice, except…
When choosing a distributed system… 
vs.
… You Can’t Sacrifice Partition Tolerance! 
NOTDistributed 
(a.k.a. NOTPartition Tolerant) 
Available 
AND 
Consistent 
Distributed 
(a.k.a. Partition Tolerant) 
Available 
OR 
Consistent 
_ 
_
CPvs. AP 
Synchronous. 
Waits until partition heals or times out. 
Asynchronous. 
Returns a reasonable response always.
CPvs. AP 
Synchronous. 
Waits until partition heals or times out. 
Asynchronous. 
Returns a reasonable response always. 
At a bank, you get a deposit receipt afterthe work is complete 
At a coffee shop, you get a receipt beforethe work is complete
CHAPTER 
Whendo companies care?
Companies care about internetscale
Distributed Storage Past 
2004 
Google’s Map Reduce paper published 
2006 
Google’s Big Table paper published 
2007 
Amazon’s Dynamo paper published 
2008 
Yahoo runs search on Hadoop 
2008 
Facebook open sources Cassandra 
2008 
Bitcoin paper published 
2009 
Yahoo open sources Hadoop 
2010 
Azure Table Storage released 
2012 
Google’s Spanner and F1 papers 
2013 
Amazon releases DynamoDB inside AWS 
2014 
Google’s Mesa paper published 
2015 
????
Looking forward 
•Open source implementations of more sophisticated storage systems 
•Managed services with more advanced capabilities 
•Google Cloud versions of F1, Spanner, or Mesa? 
•NoSQL + SQL 
•Distributed data storage in untrusted environments
CHAPTER 
How does this affect me
Even our most “legacy” clients are already starting to care about internet scale: 
_
Petabytes and Nanoseconds
Scenario 
Client = Energy Retailer (Independent Sales Force) 
Sales Agent captures info about potential customer 
Price generated on-demand based on daily rate curve 
Quote no longer valid at midnight 
Each night, rates are updated based on new rate-curve 
Used to take 4hours 
Now takes > 24hours (Due to increased demand)
Current State
Solution Strategy 
Assess 
•Analyze business performance needs 
•Select non-performing work streams 
•Filter –(Could/Should) 
•Prioritize 
•Performance Baseline / Load Test 
Strategize 
•Identify Bottlenecks (CPU/RAM/Network) 
•Optimization strategy 
•Technology Selection 
Implement 
•POC 
•Load Test 
•Optimize 
•Build
Optimize Code 
Scale Up 
Scale Out 
Managed Service
Optimize CodeLevel 1 
Least organizational impact 
No architecture changes required 
Use existing development processes 
Risky –Code may be fine 
Expensive –Dev Resources 
Time Consuming –Dev + Deploy
Scale UpLevel 2 
Easiest solution 
Utilize existing infrastructure 
Little/no architecture changes 
Low probability of network partitions 
May not solve the problem long-term 
Hardware limitations 
Non-linear improvement (2x RAM != 2x Performance) 
C/A
Scale OutLevel 3 
Highest throughput 
Improved system up-time 
No single point of failure 
Linear performance increases 
Use commodity hardware –Hard to scale-up CPU 
Increased infrastructure / system complexity 
Increased probability of network partitions 
Automation complexity 
A/C
Managed ServiceLevel 4 
Low barrier to entry 
No additional hardware investment required 
Treat as extension of existing data center 
Appliance configuration 
Globally redundant (cloud) 
Most organizational change 
Less control and customization 
Built-in redundancy and innovation 
C/A 
A/C
Optimize Code(Level 1) 
•Least organizational impact 
•No architecture changes required 
•Use existing development processes 
•Risky –Code may be fine 
•Expensive –Dev Resources 
•Time Consuming –Dev + Deploy 
Scale Up(Level 2) 
•Easiest solution 
•Utilize existing infrastructure 
•Little/no architecture changes 
•Reduce probability of network partitions 
•May not solve the problem long-term 
•Hardware limitations 
•Non-linear improvement 
Scale Out(Level 3) 
•Highest throughput 
•Improved system up-time 
•No single point of failure 
•Linear performance inc. 
•Use commodity hardware 
•Increased infrastructure / system complexity 
•Increased probability of network partitions 
•Automation complexity 
Managed Service(Level 4) 
•Low barrier to entry 
•No additional hardware investment required 
•Treat as extension of existing data center 
•Appliance configuration 
•Globally redundant (cloud) 
•Most organizational change 
•Less control and customization 
•High innovation 
Pick One (Or More!)
First Attempt
Good Enough?
Taking It to the Next Level
The Best Solution?
What Would YOUDo?
Fin’ 
robert.greiner@parivedasolutions.com 
nathan.murray@parivedasolutions.com

More Related Content

PPTX
Security as an Enabler – Cloud Security
PDF
Ask The Architect: RightScale & AWS Dive Deep into Hybrid IT
PPTX
CSC AWS re:Invent Enterprise DevOps session
PPTX
Azure intelligent edge solutions overview
PDF
Introduction to RightScale
PDF
RightScale Webinar: Hybrid-IT: Connecting Your On-Premises Infrastructure Wit...
PPTX
Trends in Cloud and Mobile Computing - Alain Azagury, IBM
PPT
How to Get Cloud Architecture and Design Right the First Time
Security as an Enabler – Cloud Security
Ask The Architect: RightScale & AWS Dive Deep into Hybrid IT
CSC AWS re:Invent Enterprise DevOps session
Azure intelligent edge solutions overview
Introduction to RightScale
RightScale Webinar: Hybrid-IT: Connecting Your On-Premises Infrastructure Wit...
Trends in Cloud and Mobile Computing - Alain Azagury, IBM
How to Get Cloud Architecture and Design Right the First Time

Viewers also liked (6)

PPTX
Fin fest 2014 - Internet of Things and APIs
PPTX
Testing javascript
PPTX
Test Driven Development at 10,000 Feet
PPTX
Code Quality and Tipster
PPTX
Automated Testing for Websites With Selenium IDE
PDF
Introduction to Amazon Web Services
Fin fest 2014 - Internet of Things and APIs
Testing javascript
Test Driven Development at 10,000 Feet
Code Quality and Tipster
Automated Testing for Websites With Selenium IDE
Introduction to Amazon Web Services
Ad

Similar to Petabytes and Nanoseconds (20)

PPTX
Architecting for Massive Scalability - St. Louis Day of .NET 2011 - Aug 6, 2011
PDF
Pivotal gem fire_wp_hardest-problems-data-management_053013
 
PPTX
Prisoner's Dilemma and Service-oriented Architectures
PPTX
CAP and BASE
PDF
Distributed Systems: scalability and high availability
PPT
Cloud computing skepticism - But i'm sure
PPTX
Handling Data in Mega Scale Systems
PDF
Scalability
PDF
Azure and cloud design patterns
PDF
SpringPeople - Introduction to Cloud Computing
PDF
Why Distributed Databases?
PPT
Key Challenges in Cloud Computing and How Yahoo! is Approaching Them
PPT
Architecture to Scale. DONN ROCHETTE at Big Data Spain 2012
PPTX
Microservices, Distributed Computing and CAP Theorem
PPTX
Cloud Computing - Foundations, Perspectives & Challenges
PPTX
Distributed System explained (with Java Microservices)
PDF
Highly available distributed databases, how they work, javier ramirez at teowaki
PDF
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
PDF
System design handwritten notes guidance
PPTX
It camp 2015 how to scale above clouds limits, radu vunvulea
Architecting for Massive Scalability - St. Louis Day of .NET 2011 - Aug 6, 2011
Pivotal gem fire_wp_hardest-problems-data-management_053013
 
Prisoner's Dilemma and Service-oriented Architectures
CAP and BASE
Distributed Systems: scalability and high availability
Cloud computing skepticism - But i'm sure
Handling Data in Mega Scale Systems
Scalability
Azure and cloud design patterns
SpringPeople - Introduction to Cloud Computing
Why Distributed Databases?
Key Challenges in Cloud Computing and How Yahoo! is Approaching Them
Architecture to Scale. DONN ROCHETTE at Big Data Spain 2012
Microservices, Distributed Computing and CAP Theorem
Cloud Computing - Foundations, Perspectives & Challenges
Distributed System explained (with Java Microservices)
Highly available distributed databases, how they work, javier ramirez at teowaki
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
System design handwritten notes guidance
It camp 2015 how to scale above clouds limits, radu vunvulea
Ad

More from Robert Greiner (9)

PDF
Portfolio Rationalization - Making Sound Financial and Strategic Decisions in...
PPTX
Virtual Team Best Practices
PDF
Becoming the Ideal Team Player
PDF
POV - Practical Containerization
PDF
POV - Enterprise Security Canvas
PPTX
Foundations of financial independence
PPTX
Why feedback is important
PDF
Infrastructure as Code
PPTX
Introduction to Windows Azure Data Services
Portfolio Rationalization - Making Sound Financial and Strategic Decisions in...
Virtual Team Best Practices
Becoming the Ideal Team Player
POV - Practical Containerization
POV - Enterprise Security Canvas
Foundations of financial independence
Why feedback is important
Infrastructure as Code
Introduction to Windows Azure Data Services

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Modernizing your data center with Dell and AMD
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
KodekX | Application Modernization Development
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Modernizing your data center with Dell and AMD
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KodekX | Application Modernization Development
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25 Week I
CIFDAQ's Market Insight: SEC Turns Pro Crypto
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars

Petabytes and Nanoseconds

  • 1. Petabytes and Nanoseconds Distributed Data Storage andthe CAP Theorem FIN talk Robert Greiner Nathan Murray August 21,2014
  • 2. CHAPTER The Problems Your phone can add two numbers in the same time it takes light to travel one foot All high frequency trading servers are connected to the NASDAQ network with the same length of cable, so that no party has a speed advantage
  • 3. A Common Scenario Web Application RDBMS + =
  • 4. The Solution: Scale All the Things!!1
  • 5. Why shouldwe scale? Throughput Latency Storage Reliability
  • 6. The Solution? Add a load balancer Add more web servers Tune the DB. Indexes,SPs, etc.
  • 7. There’sa new bottleneck Generally an RDBMS can becomea bottleneck around 10K transactions per second
  • 8. Next Step… Distribute Your Data Each web server can talk to any data storage node Nodes distribute queries and replicate data – lots more complexity!
  • 9. Cluster = Additional Complexity
  • 10. Enter the CAP Theorem! This guy created the CAP Theorem This guy’s VP Invented the internet
  • 11. CAP Theorem: Defined Within a distributed system, you can only make two of the following three guarantees across a write/read pair
  • 12. Guarantee 1: Consistency If a value is written, and then fetched, I will alwaysget back the new value Note: not the same as the C in ACID! _
  • 13. Guarantee 2: Availability If a value is written, a success message should always be returned. If a subsequent read returns a stale value, or something reasonable, it’s OK. _ Note: not the same as the A in HA!
  • 14. Guarantee 3: Partition Tolerance The system will continue to function when network partitions occur –OOP != NP. _ Note: nothing to do with BAC!
  • 15. CAP Triangle The CAP Theorem is explained as a triangle C, A or P: Pick two This is true in practice, except…
  • 16. When choosing a distributed system… vs.
  • 17. … You Can’t Sacrifice Partition Tolerance! NOTDistributed (a.k.a. NOTPartition Tolerant) Available AND Consistent Distributed (a.k.a. Partition Tolerant) Available OR Consistent _ _
  • 18. CPvs. AP Synchronous. Waits until partition heals or times out. Asynchronous. Returns a reasonable response always.
  • 19. CPvs. AP Synchronous. Waits until partition heals or times out. Asynchronous. Returns a reasonable response always. At a bank, you get a deposit receipt afterthe work is complete At a coffee shop, you get a receipt beforethe work is complete
  • 21. Companies care about internetscale
  • 22. Distributed Storage Past 2004 Google’s Map Reduce paper published 2006 Google’s Big Table paper published 2007 Amazon’s Dynamo paper published 2008 Yahoo runs search on Hadoop 2008 Facebook open sources Cassandra 2008 Bitcoin paper published 2009 Yahoo open sources Hadoop 2010 Azure Table Storage released 2012 Google’s Spanner and F1 papers 2013 Amazon releases DynamoDB inside AWS 2014 Google’s Mesa paper published 2015 ????
  • 23. Looking forward •Open source implementations of more sophisticated storage systems •Managed services with more advanced capabilities •Google Cloud versions of F1, Spanner, or Mesa? •NoSQL + SQL •Distributed data storage in untrusted environments
  • 24. CHAPTER How does this affect me
  • 25. Even our most “legacy” clients are already starting to care about internet scale: _
  • 27. Scenario Client = Energy Retailer (Independent Sales Force) Sales Agent captures info about potential customer Price generated on-demand based on daily rate curve Quote no longer valid at midnight Each night, rates are updated based on new rate-curve Used to take 4hours Now takes > 24hours (Due to increased demand)
  • 29. Solution Strategy Assess •Analyze business performance needs •Select non-performing work streams •Filter –(Could/Should) •Prioritize •Performance Baseline / Load Test Strategize •Identify Bottlenecks (CPU/RAM/Network) •Optimization strategy •Technology Selection Implement •POC •Load Test •Optimize •Build
  • 30. Optimize Code Scale Up Scale Out Managed Service
  • 31. Optimize CodeLevel 1 Least organizational impact No architecture changes required Use existing development processes Risky –Code may be fine Expensive –Dev Resources Time Consuming –Dev + Deploy
  • 32. Scale UpLevel 2 Easiest solution Utilize existing infrastructure Little/no architecture changes Low probability of network partitions May not solve the problem long-term Hardware limitations Non-linear improvement (2x RAM != 2x Performance) C/A
  • 33. Scale OutLevel 3 Highest throughput Improved system up-time No single point of failure Linear performance increases Use commodity hardware –Hard to scale-up CPU Increased infrastructure / system complexity Increased probability of network partitions Automation complexity A/C
  • 34. Managed ServiceLevel 4 Low barrier to entry No additional hardware investment required Treat as extension of existing data center Appliance configuration Globally redundant (cloud) Most organizational change Less control and customization Built-in redundancy and innovation C/A A/C
  • 35. Optimize Code(Level 1) •Least organizational impact •No architecture changes required •Use existing development processes •Risky –Code may be fine •Expensive –Dev Resources •Time Consuming –Dev + Deploy Scale Up(Level 2) •Easiest solution •Utilize existing infrastructure •Little/no architecture changes •Reduce probability of network partitions •May not solve the problem long-term •Hardware limitations •Non-linear improvement Scale Out(Level 3) •Highest throughput •Improved system up-time •No single point of failure •Linear performance inc. •Use commodity hardware •Increased infrastructure / system complexity •Increased probability of network partitions •Automation complexity Managed Service(Level 4) •Low barrier to entry •No additional hardware investment required •Treat as extension of existing data center •Appliance configuration •Globally redundant (cloud) •Most organizational change •Less control and customization •High innovation Pick One (Or More!)
  • 38. Taking It to the Next Level