SlideShare a Scribd company logo
1 of 20
Scaling to Meet Application Demand
                                              Jeff Mace




©Continuent 2012
Agenda

              • MySQL vs Tungsten Replication
              • Simple Replication with demo
              • Advanced Replication
              • Best Practices




©Continuent 2012                 2
Tungsten Replication

              • Compatible with MySQL 5.0+
              • Compatible with most MySQL branches
              • Crash safe if you use InnoDB
              • Replicate between different versions
              • Replicate from multiple masters into one
                   server

              • Filter replication traffic in real time

©Continuent 2012                     3
MySQL Replication

      Master DB    Binary Log                   Relay Log        SQL       Slave DB


          Tungsten Replication


          Binary Log   Extractor   Transactio               Transactio   Applier
                                    n History                n History




          Master DB                                                      Slave DB

©Continuent 2012                            4
I have a great idea for a website!

              • Rapid prototype        ha-proxy
              • Load-balanced web
                   servers

              • Single database
                   server

              • Single schema design

                                       Master DB


©Continuent 2012                  5
But what if something goes wrong?

              • Stand-by slave                   ha-proxy
              • Can write to it if
                   the first server
                   fails

              • Extremely difficult
                   to restore the
                   primary master



                                          Master DB     Slave DB

©Continuent 2012                      6
Simplifying the restore process

              • Replication
                   position                      ha-proxy
                   automatically
                   saved in backups

              • Ensure all writes
                   have been made
                   on the slave
                   before switching
                   to it

                                          Master DB   Standby Master


©Continuent 2012                      7
Installation - db1

  tools/tungsten-installer 
  --master-slave
  --home-directory=/opt/continuent 
  --hosts=db1 
  --master-host=db1 
  --service-name=alpha ...

  /opt/continuent/tungsten/tools/configure-service 
  -C --role=slave 
  --master-thl-host=db2 
  --datasource=db1 
  --service-type=remote
©Continuent 2012               8
Installation - db2

  tools/tungsten-installer 
  --master-slave 
  --home-directory=/opt/continuent 
  --hosts=db2 
  --master-host=db2 
  --service-name=bravo ...

  /opt/continuent/tungsten/tools/configure-service 
  -C --role=slave 
  --master-thl-host=db1 
  --datasource=db2 
  --service-type=remote
©Continuent 2012               9
Demo


©Continuent 2012    10
I need more than two servers


                   Master DB                Master DB



                                           What if this link fails?



                               Master DB




©Continuent 2012                     11
The safer way to add servers

                   all-masters        star-schema




©Continuent 2012                 12
How do I avoid conflicting
          updates?

              • Writes to many servers can cause conflicts
              • Identify a master server for each schema
              • All updates are made to that server
              • Replication propagates the changes to
                   remaining servers

              • Reads must be made from the master
                   server



©Continuent 2012                       13
Supporting Application Growth

              • Optimize MySQL
              • Utilize replicas for read-scaling
              • Implement sharding for write-scaling
              • Plan for failover
              • Monitor everything


©Continuent 2012                  14
Planning for Sharded Databases

              • Build your application to be shard-aware
              • Don’t use foreign keys that cross schemas
              • Minimize DML statements that use
                   multiple schemas

              • Set the schema via the ‘use’ command
              • Build a fan-in server for reporting


©Continuent 2012                      15
Fan-In Replication




©Continuent 2012           16
Identifying Shards

              • Find a logical, or convenient, boundary
                   between groups of users

              • Balance individual shard size with the
                   overall number of shards

              • If necessary, utilize a single schema to
                   assign a shard ID to each user

              • Alphabetic distribution is not guaranteed
                   to be even



©Continuent 2012                     17
From Replication to Managing Data

              • Tungsten Replicator moves data
              • It does not ensure databases are:
                   •   Protected from failures

                   •   Easy to administer

                   •   Fully utilized

              • To manage data you need cluster
                   management




©Continuent 2012                                 18
What did we learn?

              • Replication is important to ensure
                   availability

              • Some topologies over greater stability
              • Sharding provides the flexibility to
                   implement many replication topologies

              • Growth is supported by proper planning


©Continuent 2012                    19
Jeff Mace
       jeff.mace@continuent.com
       560 S. Winchester Blvd. Suite 500
       San Jose, CA 95128
       Tel (866) 998-3642
       Fax (408) 668-1009


                              http://www.continuent.com
                   http://code.google.com/p/tungsten-replicator


©Continuent 2012                           20

More Related Content

Viewers also liked

Film Trailer Questionnaire Results
Film Trailer Questionnaire ResultsFilm Trailer Questionnaire Results
Film Trailer Questionnaire Resultslydiadeb
 
Disaster Recovery with MySQL and Tungsten
Disaster Recovery with MySQL and TungstenDisaster Recovery with MySQL and Tungsten
Disaster Recovery with MySQL and TungstenJeff Mace
 
Consolidated shared indexes in real time
Consolidated shared indexes in real timeConsolidated shared indexes in real time
Consolidated shared indexes in real timeJeff Mace
 
CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...
CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...
CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...Silvina Paricio Tato
 
The Help vs. Prometheus
The Help vs. PrometheusThe Help vs. Prometheus
The Help vs. Prometheuslydiadeb
 
Human Chromosomes and Chromosome Behavior
Human Chromosomes and Chromosome BehaviorHuman Chromosomes and Chromosome Behavior
Human Chromosomes and Chromosome BehaviorKnel Luistro
 
Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)
Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)
Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)Silvina Paricio Tato
 

Viewers also liked (10)

Film Trailer Questionnaire Results
Film Trailer Questionnaire ResultsFilm Trailer Questionnaire Results
Film Trailer Questionnaire Results
 
Disaster Recovery with MySQL and Tungsten
Disaster Recovery with MySQL and TungstenDisaster Recovery with MySQL and Tungsten
Disaster Recovery with MySQL and Tungsten
 
Consolidated shared indexes in real time
Consolidated shared indexes in real timeConsolidated shared indexes in real time
Consolidated shared indexes in real time
 
Ingles
InglesIngles
Ingles
 
Saint patrick’s day
Saint patrick’s daySaint patrick’s day
Saint patrick’s day
 
CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...
CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...
CONTRIBUCIÓN DE LAS LENGUAS EXTRANJERAS AL DESARROLLO DE ACTITUDES DE TOLERAN...
 
The Help vs. Prometheus
The Help vs. PrometheusThe Help vs. Prometheus
The Help vs. Prometheus
 
Guía fp básica para as familias
Guía fp básica para as familiasGuía fp básica para as familias
Guía fp básica para as familias
 
Human Chromosomes and Chromosome Behavior
Human Chromosomes and Chromosome BehaviorHuman Chromosomes and Chromosome Behavior
Human Chromosomes and Chromosome Behavior
 
Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)
Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)
Youblisher.com 1406032-cuaderno de-informaci_n_acad_mica_para_2_de_eso_2016 (2)
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Scaling to Meet Application Demand

  • 1. Scaling to Meet Application Demand Jeff Mace ©Continuent 2012
  • 2. Agenda • MySQL vs Tungsten Replication • Simple Replication with demo • Advanced Replication • Best Practices ©Continuent 2012 2
  • 3. Tungsten Replication • Compatible with MySQL 5.0+ • Compatible with most MySQL branches • Crash safe if you use InnoDB • Replicate between different versions • Replicate from multiple masters into one server • Filter replication traffic in real time ©Continuent 2012 3
  • 4. MySQL Replication Master DB Binary Log Relay Log SQL Slave DB Tungsten Replication Binary Log Extractor Transactio Transactio Applier n History n History Master DB Slave DB ©Continuent 2012 4
  • 5. I have a great idea for a website! • Rapid prototype ha-proxy • Load-balanced web servers • Single database server • Single schema design Master DB ©Continuent 2012 5
  • 6. But what if something goes wrong? • Stand-by slave ha-proxy • Can write to it if the first server fails • Extremely difficult to restore the primary master Master DB Slave DB ©Continuent 2012 6
  • 7. Simplifying the restore process • Replication position ha-proxy automatically saved in backups • Ensure all writes have been made on the slave before switching to it Master DB Standby Master ©Continuent 2012 7
  • 8. Installation - db1 tools/tungsten-installer --master-slave --home-directory=/opt/continuent --hosts=db1 --master-host=db1 --service-name=alpha ... /opt/continuent/tungsten/tools/configure-service -C --role=slave --master-thl-host=db2 --datasource=db1 --service-type=remote ©Continuent 2012 8
  • 9. Installation - db2 tools/tungsten-installer --master-slave --home-directory=/opt/continuent --hosts=db2 --master-host=db2 --service-name=bravo ... /opt/continuent/tungsten/tools/configure-service -C --role=slave --master-thl-host=db1 --datasource=db2 --service-type=remote ©Continuent 2012 9
  • 11. I need more than two servers Master DB Master DB What if this link fails? Master DB ©Continuent 2012 11
  • 12. The safer way to add servers all-masters star-schema ©Continuent 2012 12
  • 13. How do I avoid conflicting updates? • Writes to many servers can cause conflicts • Identify a master server for each schema • All updates are made to that server • Replication propagates the changes to remaining servers • Reads must be made from the master server ©Continuent 2012 13
  • 14. Supporting Application Growth • Optimize MySQL • Utilize replicas for read-scaling • Implement sharding for write-scaling • Plan for failover • Monitor everything ©Continuent 2012 14
  • 15. Planning for Sharded Databases • Build your application to be shard-aware • Don’t use foreign keys that cross schemas • Minimize DML statements that use multiple schemas • Set the schema via the ‘use’ command • Build a fan-in server for reporting ©Continuent 2012 15
  • 17. Identifying Shards • Find a logical, or convenient, boundary between groups of users • Balance individual shard size with the overall number of shards • If necessary, utilize a single schema to assign a shard ID to each user • Alphabetic distribution is not guaranteed to be even ©Continuent 2012 17
  • 18. From Replication to Managing Data • Tungsten Replicator moves data • It does not ensure databases are: • Protected from failures • Easy to administer • Fully utilized • To manage data you need cluster management ©Continuent 2012 18
  • 19. What did we learn? • Replication is important to ensure availability • Some topologies over greater stability • Sharding provides the flexibility to implement many replication topologies • Growth is supported by proper planning ©Continuent 2012 19
  • 20. Jeff Mace jeff.mace@continuent.com 560 S. Winchester Blvd. Suite 500 San Jose, CA 95128 Tel (866) 998-3642 Fax (408) 668-1009 http://www.continuent.com http://code.google.com/p/tungsten-replicator ©Continuent 2012 20

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n