SlideShare a Scribd company logo
1 of 48
Database Scalability
                 {Patterns}

                           / Robert Treat



Wednesday, July 21, 2010
robert treat
                             omniti




Wednesday, July 21, 2010
robert treat
                              omniti
                             postgres




Wednesday, July 21, 2010
robert treat
                               omniti
                              postgres
                           oracle - mysql




Wednesday, July 21, 2010
robert treat
                                  omniti
                                 postgres
                             oracle - mysql
                           mssql - sqlite - nosql




Wednesday, July 21, 2010
What are “Database Scalability Patterns?”




Wednesday, July 21, 2010
Part Design Patterns



                                 Part Application Life-Cycle




Wednesday, July 21, 2010
Part Design Patterns



                                 Part Application Life-Cycle




Wednesday, July 21, 2010
Part Design Patterns



                                 Part Application Life-Cycle




Wednesday, July 21, 2010
Part Design Patterns



                                 Part Application Life-Cycle




Wednesday, July 21, 2010
MyFirstDatabase




Wednesday, July 21, 2010
Vertical Partitioning




Wednesday, July 21, 2010
Vertical Scaling




Wednesday, July 21, 2010
Vertical Scaling




Wednesday, July 21, 2010
Vertical Scaling




Wednesday, July 21, 2010
Federated Data Storage


              “sharding”                 Horizontal Partitioning

                           Read Slaves

                                                 Multi-Master

                 Horizontal Scaling



Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                Scale Read Load




Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                Scale Read Load


                                                      writes go here!




Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                   Scale Read Load


                                                         writes go here!




                           reads go here (or here) (or here)
Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                      Scale Read Load

          database writes
           data to slaves                                writes go here!



                           slave db      slave db   slave db


                           reads go here (or here) (or here)
Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                     Scale Read Load

          app writes data
            everywhere                                     writes go here!



                           memcached memcached memcached


                             reads go here (or here) (or here)
Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                Scale Read Load

       • Typically
         • Full Copy of Data
            On Each Node
            • Asynchronous




Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                Scale Read Load

       • Typically                         • Consider
         • Full Copy of Data                 • Partial Copy
            On Each Node                     • Synchronous
            • Asynchronous                   • Don’t use a RDBMS?




Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                 Scale Read Load

       • Typically                          • Consider
         • Full Copy of Data                  • Partial Copy
            On Each Node                      • Synchronous
            • Asynchronous                    • Don’t use a RDBMS?
                           Requires Application Changes



Wednesday, July 21, 2010
Read Slaves / Master - Slave
                                 Scale Read Load

       • Typically                          • Consider
         • Full Copy of Data                  • Partial Copy
            On Each Node                      • Synchronous
            • Asynchronous                    • Don’t use a RDBMS?
                           Requires Application Changes
                                      “easy”

Wednesday, July 21, 2010
Scaling Writes




Wednesday, July 21, 2010
Scaling Writes




                            “not easy”




Wednesday, July 21, 2010
Multi-Master

                           many different ways to implement this,
                           few that actually work in production




Wednesday, July 21, 2010
Multi-Master

                           many different ways to implement this,
                           few that actually work in production


                           write to any node, database syncs data




Wednesday, July 21, 2010
Multi-Master

                           many different ways to implement this,
                           few that actually work in production


                           write to any node, database syncs data
                             can reduce cpu, doesn’t reduce i/o




Wednesday, July 21, 2010
Multi-Master

                           many different ways to implement this,
                           few that actually work in production


                           write to any node, database syncs data
                             can reduce cpu, doesn’t reduce i/o


                                      failover solution
                                  not a scalability solution

Wednesday, July 21, 2010
Horizontal Partitioning


                           “sharding”                 “SOA”




Wednesday, July 21, 2010
Horizontal Partitioning


                           “sharding”                 “SOA”




Wednesday, July 21, 2010
Horizontal Partitioning

    • Divide schema by job operations
    • Move each piece to own server
    • Duplicate some data as needed




Wednesday, July 21, 2010
Horizontal Partitioning

                                                     items
    • Divide schema by job operations
    • Move each piece to own server
    • Duplicate some data as needed

                                                               forums



                                                       users



Wednesday, July 21, 2010
Horizontal Partitioning

                                                     items
    • Divide schema by job operations
    • Move each piece to own server
    • Duplicate some data as needed

                                                               forums
    • You must separate dependencies
    in the app code first!
                                                       users



Wednesday, July 21, 2010
Horizontal Partitioning

                                                        items
    • Divide schema by job operations
    • Move each piece to own server
    • Duplicate some data as needed

                                                                    forums
    • You must separate dependencies
    in the app code first!
                                                          users
                  Each node is a new instance of vertical scaling

Wednesday, July 21, 2010
Horizontal Scaling
             • data split across servers based on algorithm
             • data dropped into buckets (multiple?)
                                   app


   magic hash algorithm




Wednesday, July 21, 2010
Horizontal Scaling
             • data split across servers based on algorithm
             • data dropped into buckets (multiple?)


   magic hash algorithm            app




Wednesday, July 21, 2010
Horizontal Scaling
             • data split across servers based on algorithm
             • data dropped into buckets (multiple?)
             •someone must keep track of data, and provide
             lookup services

   magic hash algorithm              app




Wednesday, July 21, 2010
Universal Truths of Scaling Databases

                   Vertical Scalability is Helpful for Every Pattern


                   Even in a horizontally scaled, fully distributed
                   database, the number of nodes needed is
                   affected by vertical scalability




Wednesday, July 21, 2010
Universal Truths of Scaling Databases

                               New Nodes Are Never Free


                           • Add points of failure
                           • Add management costs
                           • Add complexity to architecture
                           • Add complexity to your app code


Wednesday, July 21, 2010
MyFirstDB
                                      V
                            Vertical Partitioning
                                      V
                              Vertical Scaling
                                      V
                                Read Slaves
                                      V
                           Horizontal Partitioning



Wednesday, July 21, 2010
tips




Wednesday, July 21, 2010
tips

                           plan for layered data sources




Wednesday, July 21, 2010
tips

                            plan for layered data sources

                           read / write connections in code




Wednesday, July 21, 2010
tips

                             plan for layered data sources

                           read / write connections in code

                           use schemas to separate services




Wednesday, July 21, 2010
THANKS!

                                  more:
                                 xzilla.net
                                @robtreat2



                              omniti.com/surge
                           (scalability conference)


Wednesday, July 21, 2010

More Related Content

Viewers also liked

Db performance optimization with indexing
Db performance optimization with indexingDb performance optimization with indexing
Db performance optimization with indexingRajeev Kumar
 
Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack Clustrix
 
Database index
Database indexDatabase index
Database indexRiteshkiit
 
Data indexing presentation
Data indexing presentationData indexing presentation
Data indexing presentationgmbmanikandan
 
What Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database ScalabilityWhat Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database Scalabilityjbellis
 
Banco de Dados Não Relacionais vs Banco de Dados Relacionais
Banco de Dados Não Relacionais vs Banco de Dados RelacionaisBanco de Dados Não Relacionais vs Banco de Dados Relacionais
Banco de Dados Não Relacionais vs Banco de Dados Relacionaisalexculpado
 
Scaling Pinterest
Scaling PinterestScaling Pinterest
Scaling PinterestC4Media
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQLRTigger
 

Viewers also liked (9)

Db performance optimization with indexing
Db performance optimization with indexingDb performance optimization with indexing
Db performance optimization with indexing
 
Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack Database Architecture & Scaling Strategies, in the Cloud & on the Rack
Database Architecture & Scaling Strategies, in the Cloud & on the Rack
 
Database index
Database indexDatabase index
Database index
 
Data indexing presentation
Data indexing presentationData indexing presentation
Data indexing presentation
 
What Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database ScalabilityWhat Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database Scalability
 
Banco de Dados Não Relacionais vs Banco de Dados Relacionais
Banco de Dados Não Relacionais vs Banco de Dados RelacionaisBanco de Dados Não Relacionais vs Banco de Dados Relacionais
Banco de Dados Não Relacionais vs Banco de Dados Relacionais
 
Scaling Pinterest
Scaling PinterestScaling Pinterest
Scaling Pinterest
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQL
 

More from Robert Treat

Advanced Int->Bigint Conversions
Advanced Int->Bigint ConversionsAdvanced Int->Bigint Conversions
Advanced Int->Bigint ConversionsRobert Treat
 
Explaining Explain
Explaining ExplainExplaining Explain
Explaining ExplainRobert Treat
 
the-lost-art-of-plpgsql
the-lost-art-of-plpgsqlthe-lost-art-of-plpgsql
the-lost-art-of-plpgsqlRobert Treat
 
Managing Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs MonitoringManaging Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs MonitoringRobert Treat
 
Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Robert Treat
 
Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016 Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016 Robert Treat
 
What Ops Can Learn From Design
What Ops Can Learn From DesignWhat Ops Can Learn From Design
What Ops Can Learn From DesignRobert Treat
 
Postgres 9.4 First Look
Postgres 9.4 First LookPostgres 9.4 First Look
Postgres 9.4 First LookRobert Treat
 
Less Alarming Alerts!
Less Alarming Alerts!Less Alarming Alerts!
Less Alarming Alerts!Robert Treat
 
Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013Robert Treat
 
Big Bad "Upgraded" Postgres
Big Bad "Upgraded" PostgresBig Bad "Upgraded" Postgres
Big Bad "Upgraded" PostgresRobert Treat
 
Managing Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentManaging Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentRobert Treat
 
The Essential PostgreSQL.conf
The Essential PostgreSQL.confThe Essential PostgreSQL.conf
The Essential PostgreSQL.confRobert Treat
 
Advanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRAdvanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRRobert Treat
 
Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)Robert Treat
 
Intro to Postgres 9 Tutorial
Intro to Postgres 9 TutorialIntro to Postgres 9 Tutorial
Intro to Postgres 9 TutorialRobert Treat
 
Database Scalability Patterns
Database Scalability PatternsDatabase Scalability Patterns
Database Scalability PatternsRobert Treat
 
A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0Robert Treat
 

More from Robert Treat (20)

Advanced Int->Bigint Conversions
Advanced Int->Bigint ConversionsAdvanced Int->Bigint Conversions
Advanced Int->Bigint Conversions
 
Explaining Explain
Explaining ExplainExplaining Explain
Explaining Explain
 
the-lost-art-of-plpgsql
the-lost-art-of-plpgsqlthe-lost-art-of-plpgsql
the-lost-art-of-plpgsql
 
Managing Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs MonitoringManaging Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs Monitoring
 
Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016
 
Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016 Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016
 
What Ops Can Learn From Design
What Ops Can Learn From DesignWhat Ops Can Learn From Design
What Ops Can Learn From Design
 
Postgres 9.4 First Look
Postgres 9.4 First LookPostgres 9.4 First Look
Postgres 9.4 First Look
 
Less Alarming Alerts!
Less Alarming Alerts!Less Alarming Alerts!
Less Alarming Alerts!
 
Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013
 
Big Bad "Upgraded" Postgres
Big Bad "Upgraded" PostgresBig Bad "Upgraded" Postgres
Big Bad "Upgraded" Postgres
 
Managing Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentManaging Databases In A DevOps Environment
Managing Databases In A DevOps Environment
 
The Essential PostgreSQL.conf
The Essential PostgreSQL.confThe Essential PostgreSQL.conf
The Essential PostgreSQL.conf
 
Pro Postgres 9
Pro Postgres 9Pro Postgres 9
Pro Postgres 9
 
Advanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRAdvanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITR
 
Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)
 
Intro to Postgres 9 Tutorial
Intro to Postgres 9 TutorialIntro to Postgres 9 Tutorial
Intro to Postgres 9 Tutorial
 
Check Please!
Check Please!Check Please!
Check Please!
 
Database Scalability Patterns
Database Scalability PatternsDatabase Scalability Patterns
Database Scalability Patterns
 
A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 

Database Scalability Patterns

  • 1. Database Scalability {Patterns} / Robert Treat Wednesday, July 21, 2010
  • 2. robert treat omniti Wednesday, July 21, 2010
  • 3. robert treat omniti postgres Wednesday, July 21, 2010
  • 4. robert treat omniti postgres oracle - mysql Wednesday, July 21, 2010
  • 5. robert treat omniti postgres oracle - mysql mssql - sqlite - nosql Wednesday, July 21, 2010
  • 6. What are “Database Scalability Patterns?” Wednesday, July 21, 2010
  • 7. Part Design Patterns Part Application Life-Cycle Wednesday, July 21, 2010
  • 8. Part Design Patterns Part Application Life-Cycle Wednesday, July 21, 2010
  • 9. Part Design Patterns Part Application Life-Cycle Wednesday, July 21, 2010
  • 10. Part Design Patterns Part Application Life-Cycle Wednesday, July 21, 2010
  • 16. Federated Data Storage “sharding” Horizontal Partitioning Read Slaves Multi-Master Horizontal Scaling Wednesday, July 21, 2010
  • 17. Read Slaves / Master - Slave Scale Read Load Wednesday, July 21, 2010
  • 18. Read Slaves / Master - Slave Scale Read Load writes go here! Wednesday, July 21, 2010
  • 19. Read Slaves / Master - Slave Scale Read Load writes go here! reads go here (or here) (or here) Wednesday, July 21, 2010
  • 20. Read Slaves / Master - Slave Scale Read Load database writes data to slaves writes go here! slave db slave db slave db reads go here (or here) (or here) Wednesday, July 21, 2010
  • 21. Read Slaves / Master - Slave Scale Read Load app writes data everywhere writes go here! memcached memcached memcached reads go here (or here) (or here) Wednesday, July 21, 2010
  • 22. Read Slaves / Master - Slave Scale Read Load • Typically • Full Copy of Data On Each Node • Asynchronous Wednesday, July 21, 2010
  • 23. Read Slaves / Master - Slave Scale Read Load • Typically • Consider • Full Copy of Data • Partial Copy On Each Node • Synchronous • Asynchronous • Don’t use a RDBMS? Wednesday, July 21, 2010
  • 24. Read Slaves / Master - Slave Scale Read Load • Typically • Consider • Full Copy of Data • Partial Copy On Each Node • Synchronous • Asynchronous • Don’t use a RDBMS? Requires Application Changes Wednesday, July 21, 2010
  • 25. Read Slaves / Master - Slave Scale Read Load • Typically • Consider • Full Copy of Data • Partial Copy On Each Node • Synchronous • Asynchronous • Don’t use a RDBMS? Requires Application Changes “easy” Wednesday, July 21, 2010
  • 27. Scaling Writes “not easy” Wednesday, July 21, 2010
  • 28. Multi-Master many different ways to implement this, few that actually work in production Wednesday, July 21, 2010
  • 29. Multi-Master many different ways to implement this, few that actually work in production write to any node, database syncs data Wednesday, July 21, 2010
  • 30. Multi-Master many different ways to implement this, few that actually work in production write to any node, database syncs data can reduce cpu, doesn’t reduce i/o Wednesday, July 21, 2010
  • 31. Multi-Master many different ways to implement this, few that actually work in production write to any node, database syncs data can reduce cpu, doesn’t reduce i/o failover solution not a scalability solution Wednesday, July 21, 2010
  • 32. Horizontal Partitioning “sharding” “SOA” Wednesday, July 21, 2010
  • 33. Horizontal Partitioning “sharding” “SOA” Wednesday, July 21, 2010
  • 34. Horizontal Partitioning • Divide schema by job operations • Move each piece to own server • Duplicate some data as needed Wednesday, July 21, 2010
  • 35. Horizontal Partitioning items • Divide schema by job operations • Move each piece to own server • Duplicate some data as needed forums users Wednesday, July 21, 2010
  • 36. Horizontal Partitioning items • Divide schema by job operations • Move each piece to own server • Duplicate some data as needed forums • You must separate dependencies in the app code first! users Wednesday, July 21, 2010
  • 37. Horizontal Partitioning items • Divide schema by job operations • Move each piece to own server • Duplicate some data as needed forums • You must separate dependencies in the app code first! users Each node is a new instance of vertical scaling Wednesday, July 21, 2010
  • 38. Horizontal Scaling • data split across servers based on algorithm • data dropped into buckets (multiple?) app magic hash algorithm Wednesday, July 21, 2010
  • 39. Horizontal Scaling • data split across servers based on algorithm • data dropped into buckets (multiple?) magic hash algorithm app Wednesday, July 21, 2010
  • 40. Horizontal Scaling • data split across servers based on algorithm • data dropped into buckets (multiple?) •someone must keep track of data, and provide lookup services magic hash algorithm app Wednesday, July 21, 2010
  • 41. Universal Truths of Scaling Databases Vertical Scalability is Helpful for Every Pattern Even in a horizontally scaled, fully distributed database, the number of nodes needed is affected by vertical scalability Wednesday, July 21, 2010
  • 42. Universal Truths of Scaling Databases New Nodes Are Never Free • Add points of failure • Add management costs • Add complexity to architecture • Add complexity to your app code Wednesday, July 21, 2010
  • 43. MyFirstDB V Vertical Partitioning V Vertical Scaling V Read Slaves V Horizontal Partitioning Wednesday, July 21, 2010
  • 45. tips plan for layered data sources Wednesday, July 21, 2010
  • 46. tips plan for layered data sources read / write connections in code Wednesday, July 21, 2010
  • 47. tips plan for layered data sources read / write connections in code use schemas to separate services Wednesday, July 21, 2010
  • 48. THANKS! more: xzilla.net @robtreat2 omniti.com/surge (scalability conference) Wednesday, July 21, 2010