SlideShare a Scribd company logo
1 of 41
Download to read offline
Caching, sharding, distributing - Scaling best practices.
    18.11.2009

    Lars Jankowfsky

    CTO swoodoo AG




Mittwoch, 18. November 2009
About me:



                              PHP, C++, Developer, Software Architect since 1992

                              PHP since 1998

                              Many successful projects from 2 to 20 developers

                              Running right now three projects using eXtreme
                              Programming

                              CTO and (Co-)Founder swoodoo AG

                              (Co-)Founder OXID eSales AG



Mittwoch, 18. November 2009
LOAD?




                         Average 17, Maximum 138

Mittwoch, 18. November 2009
Scaling?




                              Scaling   Distributing



                              Caching    Sharding




Mittwoch, 18. November 2009
(c) istockphoto


Mittwoch, 18. November 2009
Scaling



Mittwoch, 18. November 2009
SOA                                      Scaling




                  Your App    Your App   Your App


                  Your App    Your App   Your App




Mittwoch, 18. November 2009
SOA                                      Scaling



                              GUI/Frontend


                                  API


                              Your App
                                 Engine




                               Database



Mittwoch, 18. November 2009
SOA                                                           Scaling



                 GUI/Frontend         GUI/Frontend         GUI/Frontend



                                API                  API




                                         Engine




                                       Database


Mittwoch, 18. November 2009
SOA                                             PRO



          Scalable!

          You can add Servers where you need them

          Easier maintainable

          More robust

          easy to introduce HA

          Cloud...



Mittwoch, 18. November 2009
SOA                                      CON



          A lot of work....

          Difficult to test when doing TDD

          Complex deployment




Mittwoch, 18. November 2009
Distributing



Mittwoch, 18. November 2009
Virtual Machines                                Distributing




                                   GUI   API


        Engine          Server 1   GUI   API   Server 2    DB


                                   GUI   API




Mittwoch, 18. November 2009
Virtual Machines                     Distributing



                  GUI          API         API

                 GUI
               Server 1        API
                              Server 2    API
                                         Server 2

                  GUI          API         API

                               GUI

               Engine
               Server 1        GUI
                              Server 2      DB
                                          Server 2

                               GUI
Mittwoch, 18. November 2009
Virtual Machines                                          PRO



          Easy to distribute on new hardware as needed

          Isolated, separated services even on one machine

          Easy to install when using templates (DB, GUI...)

          Very good for testing, staging




Mittwoch, 18. November 2009
Virtual Machines                                        CON



          Hardware failure....

          Costs (at least for VMWare)

          Performance penalty (15%)

          Limitations (VMWare only 4 CPU‘s, VSphere 8...)

          Some resources can‘t be virtualized (Disk I/O)




Mittwoch, 18. November 2009
Caching



Mittwoch, 18. November 2009
Mittwoch, 18. November 2009
Caching


                              GUI/Frontend



                                  API




                                Engine




                               Database



Mittwoch, 18. November 2009
Files                                           PRO



          simple, easy for the begin

          good for a „share nothing“ architecture




Mittwoch, 18. November 2009
Files                                                     CON



          hits the HDD

          consumes memory (file system cache)

          local cache, can‘t be reused by different servers

          manual handling of expiration

          serialization penalty




Mittwoch, 18. November 2009
APC                                                            PRO



          OPCODE Cache

          Invalidation and size limits are automatically handled

          good for a „share nothing“ architecture




Mittwoch, 18. November 2009
APC                                                       CON



          bloats web server (apache) process memory

          local cache, can‘t be reused by different servers




Mittwoch, 18. November 2009
memcached                                                      PRO



          can be used by several servers

          Invalidation and size limits are automatically handled




Mittwoch, 18. November 2009
memcached                         CON



          network roundtrip penalty

          serialization penalty




Mittwoch, 18. November 2009
Conclusion                                    Caching




                              File System   APC



                              memcached




Mittwoch, 18. November 2009
Conclusion                                                     Caching




                                    APC                memcached


                                  opcode                 cache
                              rarely used local data




Mittwoch, 18. November 2009
Sharding



Mittwoch, 18. November 2009
Single Table                     Database




                              Data




Mittwoch, 18. November 2009
Single Table                       PRO



          simple, easy for the begin




Mittwoch, 18. November 2009
Single Table                        CON



          slow

          read/write lock problematic

          doesn‘t scale properly




Mittwoch, 18. November 2009
Offline/Online Table                                          Database




                         Online,       Once per hour    Offline,
                        read only                      write only




                              MYISAM                     INNODB



Mittwoch, 18. November 2009
Offline/Online Table                           PRO



          simple architecture

          separation between read & write access

          very fast reads




Mittwoch, 18. November 2009
Offline/Online Table                                           CON



          writes not scalable

          generation process will take longer with more data

          „stale“ data might occur in read table, no „live“ feeling

          after generation of read table, is „cold“ again. Slow!




Mittwoch, 18. November 2009
Sharding #1 Generation                            Database




                                  Flight Server




               master         master        master    master
                 MEMORY       MEMORY         MEMORY   MEMORY




                 slave        slave          slave    slave
                 MYISAM       MYISAM         MYISAM   MYISAM

Mittwoch, 18. November 2009
Sharding #1 Generation                                      PRO



          Scalable!

          Still fast with hundreds of millions of records

          Separates Database logic from system, easy scalable

          Moving, Adding, Deleting shards on the fly

          query can be run on various machines in parallel -> Fast!




Mittwoch, 18. November 2009
Sharding #1 Generation                                        CON



          Queries are limited by shards, you can‘t join all shards

          Complex to develop, special „protocol“ needed for the queries

          Custom Queries not possible, no SQL any more in your App.

          Difficult to maintain data (import, export, purge...)

          After failure or power loss it takes a while to rebuild tables

          Memory table leak



Mittwoch, 18. November 2009
Sharding #2 Generation                             Database




                                   Flight Server




               master         master         master    master
                 INNODB        INNODB         INNODB    INNODB




                 slave        slave           slave    slave
                 MYISAM       MYISAM          MYISAM   MYISAM

Mittwoch, 18. November 2009
Sharding #2 Generation                                   PRO



          More stable (INNODB vs. MEMORY)

          Fast failover

          Slave hardware can be used for production shards




Mittwoch, 18. November 2009
Sharding #2 Generation                                       CON



          Slower ( MEMORY faster than INNODB)

          but that‘s ok, we got additional machines (slaves..)




Mittwoch, 18. November 2009
„Questions?“


Mittwoch, 18. November 2009

More Related Content

What's hot

Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptfpatton
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applicationsfpatton
 
Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV FoundationChris Adamson
 
Caching, Memcached And Rails
Caching, Memcached And RailsCaching, Memcached And Rails
Caching, Memcached And Railsguestac752c
 
Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?Kaliop-slide
 
Web assembly - Future of the Web
Web assembly - Future of the WebWeb assembly - Future of the Web
Web assembly - Future of the WebCodeValue
 
Google Web Toolkit for the Enterprise Developer - JBoss World 2009
Google Web Toolkit for the Enterprise Developer - JBoss World 2009Google Web Toolkit for the Enterprise Developer - JBoss World 2009
Google Web Toolkit for the Enterprise Developer - JBoss World 2009Fred Sauer
 
Vladimir Oane
Vladimir OaneVladimir Oane
Vladimir Oaneevensys
 
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action CachingAccelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action Cachingelliando dias
 
JRuby deployments
JRuby deploymentsJRuby deployments
JRuby deploymentsberninme
 
eZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinareZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinarRoland Benedetti
 
Compiling To Web Assembly
Compiling To Web AssemblyCompiling To Web Assembly
Compiling To Web AssemblyIgalia
 

What's hot (16)

Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScript
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applications
 
Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV Foundation
 
Caching, Memcached And Rails
Caching, Memcached And RailsCaching, Memcached And Rails
Caching, Memcached And Rails
 
Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?
 
Web assembly - Future of the Web
Web assembly - Future of the WebWeb assembly - Future of the Web
Web assembly - Future of the Web
 
Google Web Toolkit for the Enterprise Developer - JBoss World 2009
Google Web Toolkit for the Enterprise Developer - JBoss World 2009Google Web Toolkit for the Enterprise Developer - JBoss World 2009
Google Web Toolkit for the Enterprise Developer - JBoss World 2009
 
The bigrabbit
The bigrabbitThe bigrabbit
The bigrabbit
 
Vladimir Oane
Vladimir OaneVladimir Oane
Vladimir Oane
 
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action CachingAccelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
 
Video Meets Documentation
Video Meets DocumentationVideo Meets Documentation
Video Meets Documentation
 
Vim for you
Vim for youVim for you
Vim for you
 
JRuby deployments
JRuby deploymentsJRuby deployments
JRuby deployments
 
Conscious Coupling
Conscious CouplingConscious Coupling
Conscious Coupling
 
eZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinareZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinar
 
Compiling To Web Assembly
Compiling To Web AssemblyCompiling To Web Assembly
Compiling To Web Assembly
 

Similar to Caching, sharding, distributing - Scaling best practices

The Open-PC - OpenSourceExpo 2009
The Open-PC - OpenSourceExpo 2009The Open-PC - OpenSourceExpo 2009
The Open-PC - OpenSourceExpo 2009Frank Karlitschek
 
Apache Hadoop Talk at QCon
Apache Hadoop Talk at QConApache Hadoop Talk at QCon
Apache Hadoop Talk at QConCloudera, Inc.
 
Next Generation Browser Add-Ons
Next Generation Browser Add-OnsNext Generation Browser Add-Ons
Next Generation Browser Add-OnsAnant Narayanan
 
Erlang for video delivery
Erlang for video deliveryErlang for video delivery
Erlang for video deliveryHugh Watkins
 
Earning Money with Free Software - Gran Canaria Desktop Summit
Earning Money with Free Software - Gran Canaria Desktop Summit Earning Money with Free Software - Gran Canaria Desktop Summit
Earning Money with Free Software - Gran Canaria Desktop Summit Frank Karlitschek
 
The Social Desktop - Keynote Akademy 2008
The Social Desktop - Keynote Akademy 2008The Social Desktop - Keynote Akademy 2008
The Social Desktop - Keynote Akademy 2008Frank Karlitschek
 
Functional Java Script - Webtechcon 2009
Functional Java Script - Webtechcon 2009Functional Java Script - Webtechcon 2009
Functional Java Script - Webtechcon 2009wolframkriesing
 
High Performance Scaling Techniques in Golang Using Go Assembly
High Performance Scaling Techniques in Golang Using Go AssemblyHigh Performance Scaling Techniques in Golang Using Go Assembly
High Performance Scaling Techniques in Golang Using Go AssemblyMinio
 
How automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous DeliveryHow automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous DeliveryEdmund Siegfried Haselwanter
 
IS-4081, Rabbit: Reinventing Video Chat, by Philippe Clavel
IS-4081, Rabbit: Reinventing Video Chat, by Philippe ClavelIS-4081, Rabbit: Reinventing Video Chat, by Philippe Clavel
IS-4081, Rabbit: Reinventing Video Chat, by Philippe ClavelAMD Developer Central
 
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2Jazkarta, Inc.
 
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...Joone Hur
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009John Woodell
 

Similar to Caching, sharding, distributing - Scaling best practices (20)

The Open-PC - OpenSourceExpo 2009
The Open-PC - OpenSourceExpo 2009The Open-PC - OpenSourceExpo 2009
The Open-PC - OpenSourceExpo 2009
 
Apache Hadoop Talk at QCon
Apache Hadoop Talk at QConApache Hadoop Talk at QCon
Apache Hadoop Talk at QCon
 
Next Generation Browser Add-Ons
Next Generation Browser Add-OnsNext Generation Browser Add-Ons
Next Generation Browser Add-Ons
 
Rubypalooza 2009
Rubypalooza 2009Rubypalooza 2009
Rubypalooza 2009
 
Erlang for video delivery
Erlang for video deliveryErlang for video delivery
Erlang for video delivery
 
Earning Money with Free Software - Gran Canaria Desktop Summit
Earning Money with Free Software - Gran Canaria Desktop Summit Earning Money with Free Software - Gran Canaria Desktop Summit
Earning Money with Free Software - Gran Canaria Desktop Summit
 
The Social Desktop - Keynote Akademy 2008
The Social Desktop - Keynote Akademy 2008The Social Desktop - Keynote Akademy 2008
The Social Desktop - Keynote Akademy 2008
 
Scaling Django Dc09
Scaling Django Dc09Scaling Django Dc09
Scaling Django Dc09
 
Functional Java Script - Webtechcon 2009
Functional Java Script - Webtechcon 2009Functional Java Script - Webtechcon 2009
Functional Java Script - Webtechcon 2009
 
High Performance Scaling Techniques in Golang Using Go Assembly
High Performance Scaling Techniques in Golang Using Go AssemblyHigh Performance Scaling Techniques in Golang Using Go Assembly
High Performance Scaling Techniques in Golang Using Go Assembly
 
Don Schwarz App Engine Talk
Don Schwarz App Engine TalkDon Schwarz App Engine Talk
Don Schwarz App Engine Talk
 
Btree Nosql Oak
Btree Nosql OakBtree Nosql Oak
Btree Nosql Oak
 
Cloudera Desktop
Cloudera DesktopCloudera Desktop
Cloudera Desktop
 
How automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous DeliveryHow automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous Delivery
 
Processing
ProcessingProcessing
Processing
 
Plone on Amazon EC2
Plone on Amazon EC2Plone on Amazon EC2
Plone on Amazon EC2
 
IS-4081, Rabbit: Reinventing Video Chat, by Philippe Clavel
IS-4081, Rabbit: Reinventing Video Chat, by Philippe ClavelIS-4081, Rabbit: Reinventing Video Chat, by Philippe Clavel
IS-4081, Rabbit: Reinventing Video Chat, by Philippe Clavel
 
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
 
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
Accelerate graphics performance with ozone-gbm on Intel based Linux desktop s...
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
 

More from Lars Jankowfsky

Agile Development with PHP in Practice
Agile Development with PHP in PracticeAgile Development with PHP in Practice
Agile Development with PHP in PracticeLars Jankowfsky
 
Agile Entwicklung OXID Commons
Agile Entwicklung OXID CommonsAgile Entwicklung OXID Commons
Agile Entwicklung OXID CommonsLars Jankowfsky
 
Why Architecture in Web Development matters
Why Architecture in Web Development mattersWhy Architecture in Web Development matters
Why Architecture in Web Development mattersLars Jankowfsky
 
Why Architecture Matters
Why Architecture MattersWhy Architecture Matters
Why Architecture MattersLars Jankowfsky
 
Monitor Your Business V2
Monitor Your Business V2Monitor Your Business V2
Monitor Your Business V2Lars Jankowfsky
 
So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendung...
So gelingt der Umstieg von PHP4 auf  PHP5: Erneuerung von  Geschäftsanwendung...So gelingt der Umstieg von PHP4 auf  PHP5: Erneuerung von  Geschäftsanwendung...
So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendung...Lars Jankowfsky
 
Agile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei GeschäftsanwendungenAgile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei GeschäftsanwendungenLars Jankowfsky
 
Theory and practice – migrating your legacy code into our modern test drive...
Theory and practice – migrating your  legacy code into our modern test  drive...Theory and practice – migrating your  legacy code into our modern test  drive...
Theory and practice – migrating your legacy code into our modern test drive...Lars Jankowfsky
 

More from Lars Jankowfsky (10)

Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Agile Development with PHP in Practice
Agile Development with PHP in PracticeAgile Development with PHP in Practice
Agile Development with PHP in Practice
 
Agile Entwicklung OXID Commons
Agile Entwicklung OXID CommonsAgile Entwicklung OXID Commons
Agile Entwicklung OXID Commons
 
Why Architecture in Web Development matters
Why Architecture in Web Development mattersWhy Architecture in Web Development matters
Why Architecture in Web Development matters
 
Why Architecture Matters
Why Architecture MattersWhy Architecture Matters
Why Architecture Matters
 
Monitor Your Business V2
Monitor Your Business V2Monitor Your Business V2
Monitor Your Business V2
 
So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendung...
So gelingt der Umstieg von PHP4 auf  PHP5: Erneuerung von  Geschäftsanwendung...So gelingt der Umstieg von PHP4 auf  PHP5: Erneuerung von  Geschäftsanwendung...
So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendung...
 
Monitor Your Business
Monitor Your BusinessMonitor Your Business
Monitor Your Business
 
Agile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei GeschäftsanwendungenAgile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei Geschäftsanwendungen
 
Theory and practice – migrating your legacy code into our modern test drive...
Theory and practice – migrating your  legacy code into our modern test  drive...Theory and practice – migrating your  legacy code into our modern test  drive...
Theory and practice – migrating your legacy code into our modern test drive...
 

Recently uploaded

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Caching, sharding, distributing - Scaling best practices

  • 1. Caching, sharding, distributing - Scaling best practices. 18.11.2009 Lars Jankowfsky CTO swoodoo AG Mittwoch, 18. November 2009
  • 2. About me: PHP, C++, Developer, Software Architect since 1992 PHP since 1998 Many successful projects from 2 to 20 developers Running right now three projects using eXtreme Programming CTO and (Co-)Founder swoodoo AG (Co-)Founder OXID eSales AG Mittwoch, 18. November 2009
  • 3. LOAD? Average 17, Maximum 138 Mittwoch, 18. November 2009
  • 4. Scaling? Scaling Distributing Caching Sharding Mittwoch, 18. November 2009
  • 7. SOA Scaling Your App Your App Your App Your App Your App Your App Mittwoch, 18. November 2009
  • 8. SOA Scaling GUI/Frontend API Your App Engine Database Mittwoch, 18. November 2009
  • 9. SOA Scaling GUI/Frontend GUI/Frontend GUI/Frontend API API Engine Database Mittwoch, 18. November 2009
  • 10. SOA PRO Scalable! You can add Servers where you need them Easier maintainable More robust easy to introduce HA Cloud... Mittwoch, 18. November 2009
  • 11. SOA CON A lot of work.... Difficult to test when doing TDD Complex deployment Mittwoch, 18. November 2009
  • 13. Virtual Machines Distributing GUI API Engine Server 1 GUI API Server 2 DB GUI API Mittwoch, 18. November 2009
  • 14. Virtual Machines Distributing GUI API API GUI Server 1 API Server 2 API Server 2 GUI API API GUI Engine Server 1 GUI Server 2 DB Server 2 GUI Mittwoch, 18. November 2009
  • 15. Virtual Machines PRO Easy to distribute on new hardware as needed Isolated, separated services even on one machine Easy to install when using templates (DB, GUI...) Very good for testing, staging Mittwoch, 18. November 2009
  • 16. Virtual Machines CON Hardware failure.... Costs (at least for VMWare) Performance penalty (15%) Limitations (VMWare only 4 CPU‘s, VSphere 8...) Some resources can‘t be virtualized (Disk I/O) Mittwoch, 18. November 2009
  • 19. Caching GUI/Frontend API Engine Database Mittwoch, 18. November 2009
  • 20. Files PRO simple, easy for the begin good for a „share nothing“ architecture Mittwoch, 18. November 2009
  • 21. Files CON hits the HDD consumes memory (file system cache) local cache, can‘t be reused by different servers manual handling of expiration serialization penalty Mittwoch, 18. November 2009
  • 22. APC PRO OPCODE Cache Invalidation and size limits are automatically handled good for a „share nothing“ architecture Mittwoch, 18. November 2009
  • 23. APC CON bloats web server (apache) process memory local cache, can‘t be reused by different servers Mittwoch, 18. November 2009
  • 24. memcached PRO can be used by several servers Invalidation and size limits are automatically handled Mittwoch, 18. November 2009
  • 25. memcached CON network roundtrip penalty serialization penalty Mittwoch, 18. November 2009
  • 26. Conclusion Caching File System APC memcached Mittwoch, 18. November 2009
  • 27. Conclusion Caching APC memcached opcode cache rarely used local data Mittwoch, 18. November 2009
  • 29. Single Table Database Data Mittwoch, 18. November 2009
  • 30. Single Table PRO simple, easy for the begin Mittwoch, 18. November 2009
  • 31. Single Table CON slow read/write lock problematic doesn‘t scale properly Mittwoch, 18. November 2009
  • 32. Offline/Online Table Database Online, Once per hour Offline, read only write only MYISAM INNODB Mittwoch, 18. November 2009
  • 33. Offline/Online Table PRO simple architecture separation between read & write access very fast reads Mittwoch, 18. November 2009
  • 34. Offline/Online Table CON writes not scalable generation process will take longer with more data „stale“ data might occur in read table, no „live“ feeling after generation of read table, is „cold“ again. Slow! Mittwoch, 18. November 2009
  • 35. Sharding #1 Generation Database Flight Server master master master master MEMORY MEMORY MEMORY MEMORY slave slave slave slave MYISAM MYISAM MYISAM MYISAM Mittwoch, 18. November 2009
  • 36. Sharding #1 Generation PRO Scalable! Still fast with hundreds of millions of records Separates Database logic from system, easy scalable Moving, Adding, Deleting shards on the fly query can be run on various machines in parallel -> Fast! Mittwoch, 18. November 2009
  • 37. Sharding #1 Generation CON Queries are limited by shards, you can‘t join all shards Complex to develop, special „protocol“ needed for the queries Custom Queries not possible, no SQL any more in your App. Difficult to maintain data (import, export, purge...) After failure or power loss it takes a while to rebuild tables Memory table leak Mittwoch, 18. November 2009
  • 38. Sharding #2 Generation Database Flight Server master master master master INNODB INNODB INNODB INNODB slave slave slave slave MYISAM MYISAM MYISAM MYISAM Mittwoch, 18. November 2009
  • 39. Sharding #2 Generation PRO More stable (INNODB vs. MEMORY) Fast failover Slave hardware can be used for production shards Mittwoch, 18. November 2009
  • 40. Sharding #2 Generation CON Slower ( MEMORY faster than INNODB) but that‘s ok, we got additional machines (slaves..) Mittwoch, 18. November 2009