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

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
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"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
 

Recently uploaded (20)

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
 
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)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"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
 

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