SlideShare ist ein Scribd-Unternehmen logo
1 von 32
SCALABILITY

      Hodicska Gergely
              – Web Engineering Manager as Ustream
      email: felho@ustream.tv
      twitter: @felhobacsi

NOW PLAYING
SCALABILITY – BME                         1   May 7, 2012
DEFINING SCALABILITY
     It is not:
          – Performance
               Easier to scale
          – HA
     It is the ability to handle growing amount of
      work in a capable manner
     Not just technology but people and process

NOW PLAYING
SCALABILITY – BME                      2   May 7, 2012
SCALABILITY TYPES
     Vertical
          – Bigger
          – Typically more expensive
          – Sometimes feasible (DB – SSD)
     Horizontal
          – More
          – Typically we need this

NOW PLAYING
SCALABILITY – BME                           3   May 7, 2012
SCALABILITY RULES
     KISS
     Command and conquer
     Approximate correctness
     Shared nothing


NOW PLAYING
SCALABILITY – BME               4   May 7, 2012
DATABASE
     Most tough to scale
     Read -> Replication
          – Lag, cascading
     Write -> Sharding
          – App logic, vertical vs. horizontal, key server
     HA: Multi Master Replication
          – DRDB, MMM, MySQL cluster
NOW PLAYING
SCALABILITY – BME                               5    May 7, 2012
DATABASE – MULTI MASTER MYSQL
                      Virtual IP



                                   Master DB 1



                                                 20-30k req/sec
       Web cluster


                      Virtual IP                                         Load balancer       Slave cluster
                                                                            cluster



                                   Master DB 2




                           Normal write                           Failover write
        Normal read        Normal replication                     Failover replication

NOW PLAYING
SCALABILITY – BME                                                                        6        May 7, 2012
DATABASE – BACKUP STRATEGY
                                                      •
         MAATKIT     Master DB 1
         Delayed
         backup

                                                      •
                                      Slave cluster




                     Master DB 2
                                                      •
         PERCONA
        XTRABACKUP




                     Offsite backup


NOW PLAYING
SCALABILITY – BME                                         7   May 7, 2012
NOSQL
     CAP theorem (availability, consistency, partition
      tolerance -> eventual consistency)
     Diverse world
     Automatic partitioning, sharding, elasticity
     Transparent for the application
     Extendable without downtime
     Fault tolerant
     Redis, Riak, Voldemort, Cassandra, CouchBase

NOW PLAYING
SCALABILITY – BME                            8    May 7, 2012
CACHING
     Strategies
          – Write-through cache
          – Write-back cache
          – Implicit/explicit invalidation
     Consistent hashing
     Restart
NOW PLAYING
SCALABILITY – BME                            9   May 7, 2012
MEMCACHE
       Local vs. remote
       LRU
       Storing lists
       Versioning
       Race condition (cas)
       Object size
NOW PLAYING
SCALABILITY – BME              10   May 7, 2012
APP LEVEL CACHE
     Code
     Shared memory
     APC, Ehcache
     (Opcode cache)


NOW PLAYING
SCALABILITY – BME          11   May 7, 2012
HTTP LEVEL CACHING
     Cache-Control header
          – Local vs. proxy
     Static versioning
     Huge expire time


NOW PLAYING
SCALABILITY – BME             12   May 7, 2012
CACHING                                                   Web server
                                                                                    Highlights
                                                      Lightwght
                                         Request
                                                        kernel
                                                                      Response         DRSA: globally distributed reverse
                                                                                        proxy to serve the content to the users
                                         Running         Cached                         from a geographically close server
   Internet                             application     response?
     users                                                                             Cache servers: we try to cache as much
              Browser                                                                   requests on these servers as possible
               cache                                   Cached                           to offload our web cluster
                                                        data?
                                                                     Load data
                                                                                       Browser cache: all of our static assets
                        Varnish cache                                                   are automatically versioned for optimal
                           server                                                       serving (using huge expire times)
                                          Local        Image           NginX +
                                         Varnish                       Custom          Application level: caching whole pages
                                          cache                         PERL            to avoid running all the code or the
   Distributed                                                                          pieces of data to offload the database
   Remote Site
   Accelerator                                                                         Our framework automatically package
                                                                                        and compress the JS and CSS files to
                                             Other
                                                       Disk           Mogile FS         reduce the number of HTTP requests
                                                                    Static server

NOW PLAYING
SCALABILITY – BME                                                                         13         May 7, 2012
STATIC CONTENT
       NFS (mount problems)
       DB
       MogileFS
       Authentication, access control
          – Perlbal
     FS limitations
     Low hit ratio

NOW PLAYING
SCALABILITY – BME                        14   May 7, 2012
LOAD BALANCING
     Dedicated hardware vs. software based
          – Price
       HA proxy
       Nginx (HTTPS termination)
       LVS (direct routing)
       DNS loadbalance, Anycast (multi site)
       Layer 4 vs. 7

NOW PLAYING
SCALABILITY – BME                         15    May 7, 2012
SESSION
     Sticky (shared)
     Centralized
          – DB / NoSQL
          – Memcached
     Cookie
          – Sysop will like you
NOW PLAYING
SCALABILITY – BME                 16   May 7, 2012
ASYNCHRONOUS OPERATIONS
       Decoupling
       Capacity handling
       Node.js
       Jobs
          – Gearman
     Message queue
          – Q4M, RabbitMQ, ZeroMQ
NOW PLAYING
SCALABILITY – BME                   17   May 7, 2012
CHALLENGES OF THE WEB STACK
     Web requests:
          – 200 requests / sec / server (peak)
     Cache server requests:
          – 10,000 requests / sec / server (peak)
     Social stream requests:
          – 15,000 requests / sec / server (peak)
     Database requests:
          – 25,000 requests / sec / server (peak)

NOW PLAYING
SCALABILITY – BME                                   18   May 7, 2012
WEB ARCHITECTURE                  DMZ
                                                                                                             SOLR

                                                                                                             SOLR

                                                                              Site
                                                                                            Search cluster

                                                                              API

                                                                              GW
                                                                                            SCM/Monitor
               Distributed                                                    3rd party
                              IRC cluster
               Remote Site                                                                   Job manager
               Accelerator                                   Web cluster

                                                                              Varnish
                                                                                             Memcache
                                                                              NginX
                                             Load balancer
  Internet                                                                    MogileFS
    users                                                                                      Storage
                                                             Static cluster

                                                                              Site               MQ
                                                                              API                            Main

                             Social stream                                    GW                             Logs, Stats
                                cluster                                       Facebook                       MMM Monitor

                                                              Memcache                                       Slave DB
                                                               cluster
                                                                                              Database
                                                                                               cluster

NOW PLAYING
SCALABILITY – BME                                                             19          May 7, 2012
SOCIAL STREAM: UNDER THE HOOD
                                                                                        Highlights
                                                                                           Generated 2.5M visits in the last 30
                                                                     Social Stream UI
      Message                                                                               days (the 20% of this is new visitor)
      storage
                                                                                           0.8-1.1M messages per day
                                              Web cluster
                                                                                           Justin Bieber has ~230k messages
                                                                                            per day
                                                                                           Jonas Brothers concert: 10k
                                                                                            messages per minute in peak
                                                                                           Peak:
                     Q4M message queue
                                                                     Varnish/Nginx/              –   5k new connection / sec
                                                                       Redis slave
                                                                                                 –   15k requests / sec
                                                                                                 –   600 Mbit / sec

                                                                      Redis master
      Twitter   Facebook   AIM    MySpace   Mixi   Approval buffer



NOW PLAYING
SCALABILITY – BME                                                                           20        May 7, 2012
DEVELOPMENT BEST PRACTICES
     Continuous integration
          – Automated builds
          – Unit tests
          – Acceptance test
       TDD, (ADD, FDD ;))
       Abstract branching (feature switch)
       Code review, pair programming, topic experts
       DevOps culture

NOW PLAYING
SCALABILITY – BME                            21   May 7, 2012
DEVOPS TOOLING
       Provisioning
       Configuration management (cfengine, chef, puppet)
       Application deployment (capistrano, fabric)
       Orchestrator (mcollective)
       Monitoring (system/application level)
          – Nagios, Munin, Cacti, Graphite etc.
     Supervisors (monit, god)
     Log management/analysis
NOW PLAYING
SCALABILITY – BME                                 22   May 7, 2012
DEVELOPMENT BEST PRACTICES
     Visualizing
          – Graphite (StatsD, logster)
          – Custom dashboards with KPIs, alerting
       Runtime vs. build time
       Automated code deployment
       Load testing (automated better)
       MVC
NOW PLAYING
SCALABILITY – BME                           23   May 7, 2012
CONFIGURATION MANAGEMENT
     Automation
     Versioning
     Accountability
     Chef, Puppet
          – Same local dev environment

NOW PLAYING
SCALABILITY – BME                        24   May 7, 2012
CLOUD ENVIRONMENTS
     Amazon, Google App Engine etc.
     Early stage
     Cost savings
     Backup for peaks


NOW PLAYING
SCALABILITY – BME               25     May 7, 2012
ORGANIZATIONAL BEST PRACTICES
     Architect board
     Scrum of scrum
     Product board
     WESK (who else should know)
     Internal demos
NOW PLAYING
SCALABILITY – BME               26   May 7, 2012
SOURCE CODE MANAGEMENT
  •
  •

  •

  •

  •

  •




NOW PLAYING
SCALABILITY – BME          27   May 7, 2012
MONITORING
                    Highlights                            Tools
                     Proprietary dashboard to            • Munin: Several custom plugins
                      oversee key system                  • Cacti: Mainly for network devices
                      performance charts in one           • Nagios: More than 1200
                      location                              checks, Active checks
                     Real-time information about         • Monit: Ensuring that a given process
                      streaming related                     runs and it doesn’t consume too much
                      servers, web/cache                    resources, Active checks
                      servers, database servers
                                                          • Query watchdog: Automatically stops
                     Summary of the Nagios checks          and reports excessive read queries
                     Ability to roll back for historic
                      charts
                     Provides shortcut to system
                      tools


NOW PLAYING
SCALABILITY – BME                                           28         May 7, 2012
WHERE TO IMPROVE
     English
     Enjoy programming
     Soft skills (communication, team
      working, presentation, cooperation, management, leadership, time
      management etc.)
     Agile development methods (Scrum, Kanban)
     Continuous learning (blogs, books, conferences, code)
     Craftsmanship
          – Clean Coder, Agile Software Development, Martin Fowler books /
            signature series, The Mythical Man-Month, Code Complete, The
            Pragmatic Programmer, Peopleware, The Passionate Programmer

NOW PLAYING
SCALABILITY – BME                                         29    May 7, 2012
WHERE TO IMPROVE
     Network programming, protocols
     Algorithms
     DHT
     Database
     Big Data (Hadoop, HBase, Hive/Pig, BI tools etc.)
     API design (REST, SOAP, oAuth etc.)
     Playing with open source tools of big companies
      (Twitter, FB, Linkedin)
     Blogging, taking part in open source projects
     Learning different type of programming (e.g. functional)

NOW PLAYING
SCALABILITY – BME                                     30     May 7, 2012
THANK YOU


                    Questions?




NOW PLAYING
SCALABILITY – BME                31   May 7, 2012
NOW PLAYING
SCALABILITY – BME   32   May 7, 2012

Weitere ähnliche Inhalte

Was ist angesagt?

Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architecturesPooja Dixit
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization Hafiz faiz
 
NIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference ArchitectureNIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference ArchitectureThanakrit Lersmethasakul
 
Importance of software architecture 1
Importance of software architecture 1Importance of software architecture 1
Importance of software architecture 1Dr Reeja S R
 
Basics of Network Traffic Management
Basics of Network Traffic ManagementBasics of Network Traffic Management
Basics of Network Traffic ManagementPuneet Bawa
 
What is NoSQL and CAP Theorem
What is NoSQL and CAP TheoremWhat is NoSQL and CAP Theorem
What is NoSQL and CAP TheoremRahul Jain
 
Ddb 1.6-design issues
Ddb 1.6-design issuesDdb 1.6-design issues
Ddb 1.6-design issuesEsar Qasmi
 
Distributed computing
Distributed computingDistributed computing
Distributed computingshivli0769
 
Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...
Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...
Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...Majid Hajibaba
 
Implementation levels of virtualization
Implementation levels of virtualizationImplementation levels of virtualization
Implementation levels of virtualizationGokulnath S
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecturetyrantbrian
 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docxkumari36
 

Was ist angesagt? (20)

Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization
 
NIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference ArchitectureNIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference Architecture
 
Cloud Computing & Distributed Computing
Cloud Computing & Distributed ComputingCloud Computing & Distributed Computing
Cloud Computing & Distributed Computing
 
Importance of software architecture 1
Importance of software architecture 1Importance of software architecture 1
Importance of software architecture 1
 
Basics of Network Traffic Management
Basics of Network Traffic ManagementBasics of Network Traffic Management
Basics of Network Traffic Management
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
cluster computing
cluster computingcluster computing
cluster computing
 
What is NoSQL and CAP Theorem
What is NoSQL and CAP TheoremWhat is NoSQL and CAP Theorem
What is NoSQL and CAP Theorem
 
Comet Cloud
Comet CloudComet Cloud
Comet Cloud
 
NOsql Presentation.pdf
NOsql Presentation.pdfNOsql Presentation.pdf
NOsql Presentation.pdf
 
Ddb 1.6-design issues
Ddb 1.6-design issuesDdb 1.6-design issues
Ddb 1.6-design issues
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
OLAP
OLAPOLAP
OLAP
 
Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...
Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...
Cloud Computing Principles and Paradigms: 5 virtual machines provisioning and...
 
The CAP Theorem
The CAP Theorem The CAP Theorem
The CAP Theorem
 
Implementation levels of virtualization
Implementation levels of virtualizationImplementation levels of virtualization
Implementation levels of virtualization
 
Memory virtualization
Memory virtualizationMemory virtualization
Memory virtualization
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docx
 

Andere mochten auch

Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...
Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...
Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...Nagios
 
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...Cyrille Le Clerc
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewNagios
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsNagios
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The HoodNagios
 
Cours - Supervision SysRes et Présentation de Nagios
Cours - Supervision SysRes et Présentation de NagiosCours - Supervision SysRes et Présentation de Nagios
Cours - Supervision SysRes et Présentation de NagiosErwan 'Labynocle' Ben Souiden
 
Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best PracticesNagios
 

Andere mochten auch (7)

Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...
Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...
Nagios Conference 2013 - Shamas Demoret - Power Up! The Multifaceted Benefits...
 
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture Overview
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient Notifications
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The Hood
 
Cours - Supervision SysRes et Présentation de Nagios
Cours - Supervision SysRes et Présentation de NagiosCours - Supervision SysRes et Présentation de Nagios
Cours - Supervision SysRes et Présentation de Nagios
 
Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best Practices
 

Ähnlich wie Scalability

SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloudaidanshribman
 
Cloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsCloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsMark Slingsby
 
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...EMC Forum India
 
Sap On Esx Backup Methodology
Sap On Esx   Backup MethodologySap On Esx   Backup Methodology
Sap On Esx Backup MethodologyMaarten Daniels
 
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)Ontico
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbaseiammutex
 
Using Distributed In-Memory Computing for Fast Data Analysis
Using Distributed In-Memory Computing for Fast Data AnalysisUsing Distributed In-Memory Computing for Fast Data Analysis
Using Distributed In-Memory Computing for Fast Data AnalysisScaleOut Software
 
Sql 2012 always on
Sql 2012 always onSql 2012 always on
Sql 2012 always ondilip nayak
 
Lego Cloud SAP Virtualization Week 2012
Lego Cloud SAP Virtualization Week 2012Lego Cloud SAP Virtualization Week 2012
Lego Cloud SAP Virtualization Week 2012Benoit Hudzia
 
Tailoring NAS Proxies for Virtual Machines
Tailoring NAS Proxies for Virtual MachinesTailoring NAS Proxies for Virtual Machines
Tailoring NAS Proxies for Virtual MachinesThe Linux Foundation
 
vRanger feature overview august 2012 - dell-maxwell
vRanger feature overview   august 2012 - dell-maxwellvRanger feature overview   august 2012 - dell-maxwell
vRanger feature overview august 2012 - dell-maxwellDell_Maxwell
 
SDEC2011 Big engineer vs small entreprenuer
SDEC2011 Big engineer vs small entreprenuerSDEC2011 Big engineer vs small entreprenuer
SDEC2011 Big engineer vs small entreprenuerKorea Sdec
 
VMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliancesVMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliancessubtitle
 
Membase Meetup Chicago - january 2011
Membase Meetup Chicago - january 2011Membase Meetup Chicago - january 2011
Membase Meetup Chicago - january 2011Membase
 
Gemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSqlGemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSqlDuchess France
 
IP Expo 2012 Storage Lab Presentation - Nimble Storage
IP Expo 2012 Storage Lab Presentation - Nimble StorageIP Expo 2012 Storage Lab Presentation - Nimble Storage
IP Expo 2012 Storage Lab Presentation - Nimble Storageresponsedatacomms
 
인메모리 클러스터링 아키텍처
인메모리 클러스터링 아키텍처인메모리 클러스터링 아키텍처
인메모리 클러스터링 아키텍처Jaehong Cheon
 
Windows Server 2012 - Dynamische opslag met Storage Pools
Windows Server 2012 - Dynamische opslag met Storage PoolsWindows Server 2012 - Dynamische opslag met Storage Pools
Windows Server 2012 - Dynamische opslag met Storage PoolsCompuTrain. De IT opleider.
 
Cloudian_Cassandra Summit 2012
Cloudian_Cassandra Summit 2012Cloudian_Cassandra Summit 2012
Cloudian_Cassandra Summit 2012CLOUDIAN KK
 

Ähnlich wie Scalability (20)

SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloud
 
Cloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsCloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web Apps
 
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
 
Sap On Esx Backup Methodology
Sap On Esx   Backup MethodologySap On Esx   Backup Methodology
Sap On Esx Backup Methodology
 
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbase
 
Using Distributed In-Memory Computing for Fast Data Analysis
Using Distributed In-Memory Computing for Fast Data AnalysisUsing Distributed In-Memory Computing for Fast Data Analysis
Using Distributed In-Memory Computing for Fast Data Analysis
 
Sql 2012 always on
Sql 2012 always onSql 2012 always on
Sql 2012 always on
 
Lego Cloud SAP Virtualization Week 2012
Lego Cloud SAP Virtualization Week 2012Lego Cloud SAP Virtualization Week 2012
Lego Cloud SAP Virtualization Week 2012
 
Tailoring NAS Proxies for Virtual Machines
Tailoring NAS Proxies for Virtual MachinesTailoring NAS Proxies for Virtual Machines
Tailoring NAS Proxies for Virtual Machines
 
vRanger feature overview august 2012 - dell-maxwell
vRanger feature overview   august 2012 - dell-maxwellvRanger feature overview   august 2012 - dell-maxwell
vRanger feature overview august 2012 - dell-maxwell
 
SDEC2011 Big engineer vs small entreprenuer
SDEC2011 Big engineer vs small entreprenuerSDEC2011 Big engineer vs small entreprenuer
SDEC2011 Big engineer vs small entreprenuer
 
VMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliancesVMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliances
 
Lsi Nytro Flash 101 May 2012
Lsi Nytro Flash 101 May 2012Lsi Nytro Flash 101 May 2012
Lsi Nytro Flash 101 May 2012
 
Membase Meetup Chicago - january 2011
Membase Meetup Chicago - january 2011Membase Meetup Chicago - january 2011
Membase Meetup Chicago - january 2011
 
Gemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSqlGemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSql
 
IP Expo 2012 Storage Lab Presentation - Nimble Storage
IP Expo 2012 Storage Lab Presentation - Nimble StorageIP Expo 2012 Storage Lab Presentation - Nimble Storage
IP Expo 2012 Storage Lab Presentation - Nimble Storage
 
인메모리 클러스터링 아키텍처
인메모리 클러스터링 아키텍처인메모리 클러스터링 아키텍처
인메모리 클러스터링 아키텍처
 
Windows Server 2012 - Dynamische opslag met Storage Pools
Windows Server 2012 - Dynamische opslag met Storage PoolsWindows Server 2012 - Dynamische opslag met Storage Pools
Windows Server 2012 - Dynamische opslag met Storage Pools
 
Cloudian_Cassandra Summit 2012
Cloudian_Cassandra Summit 2012Cloudian_Cassandra Summit 2012
Cloudian_Cassandra Summit 2012
 

Kürzlich hochgeladen

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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Kürzlich hochgeladen (20)

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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Scalability

  • 1. SCALABILITY  Hodicska Gergely – Web Engineering Manager as Ustream  email: felho@ustream.tv  twitter: @felhobacsi NOW PLAYING SCALABILITY – BME 1 May 7, 2012
  • 2. DEFINING SCALABILITY  It is not: – Performance  Easier to scale – HA  It is the ability to handle growing amount of work in a capable manner  Not just technology but people and process NOW PLAYING SCALABILITY – BME 2 May 7, 2012
  • 3. SCALABILITY TYPES  Vertical – Bigger – Typically more expensive – Sometimes feasible (DB – SSD)  Horizontal – More – Typically we need this NOW PLAYING SCALABILITY – BME 3 May 7, 2012
  • 4. SCALABILITY RULES  KISS  Command and conquer  Approximate correctness  Shared nothing NOW PLAYING SCALABILITY – BME 4 May 7, 2012
  • 5. DATABASE  Most tough to scale  Read -> Replication – Lag, cascading  Write -> Sharding – App logic, vertical vs. horizontal, key server  HA: Multi Master Replication – DRDB, MMM, MySQL cluster NOW PLAYING SCALABILITY – BME 5 May 7, 2012
  • 6. DATABASE – MULTI MASTER MYSQL Virtual IP Master DB 1 20-30k req/sec Web cluster Virtual IP Load balancer Slave cluster cluster Master DB 2 Normal write Failover write Normal read Normal replication Failover replication NOW PLAYING SCALABILITY – BME 6 May 7, 2012
  • 7. DATABASE – BACKUP STRATEGY • MAATKIT Master DB 1 Delayed backup • Slave cluster Master DB 2 • PERCONA XTRABACKUP Offsite backup NOW PLAYING SCALABILITY – BME 7 May 7, 2012
  • 8. NOSQL  CAP theorem (availability, consistency, partition tolerance -> eventual consistency)  Diverse world  Automatic partitioning, sharding, elasticity  Transparent for the application  Extendable without downtime  Fault tolerant  Redis, Riak, Voldemort, Cassandra, CouchBase NOW PLAYING SCALABILITY – BME 8 May 7, 2012
  • 9. CACHING  Strategies – Write-through cache – Write-back cache – Implicit/explicit invalidation  Consistent hashing  Restart NOW PLAYING SCALABILITY – BME 9 May 7, 2012
  • 10. MEMCACHE  Local vs. remote  LRU  Storing lists  Versioning  Race condition (cas)  Object size NOW PLAYING SCALABILITY – BME 10 May 7, 2012
  • 11. APP LEVEL CACHE  Code  Shared memory  APC, Ehcache  (Opcode cache) NOW PLAYING SCALABILITY – BME 11 May 7, 2012
  • 12. HTTP LEVEL CACHING  Cache-Control header – Local vs. proxy  Static versioning  Huge expire time NOW PLAYING SCALABILITY – BME 12 May 7, 2012
  • 13. CACHING Web server Highlights Lightwght Request kernel Response  DRSA: globally distributed reverse proxy to serve the content to the users Running Cached from a geographically close server Internet application response? users  Cache servers: we try to cache as much Browser requests on these servers as possible cache Cached to offload our web cluster data? Load data  Browser cache: all of our static assets Varnish cache are automatically versioned for optimal server serving (using huge expire times) Local Image NginX + Varnish Custom  Application level: caching whole pages cache PERL to avoid running all the code or the Distributed pieces of data to offload the database Remote Site Accelerator  Our framework automatically package and compress the JS and CSS files to Other Disk Mogile FS reduce the number of HTTP requests Static server NOW PLAYING SCALABILITY – BME 13 May 7, 2012
  • 14. STATIC CONTENT  NFS (mount problems)  DB  MogileFS  Authentication, access control – Perlbal  FS limitations  Low hit ratio NOW PLAYING SCALABILITY – BME 14 May 7, 2012
  • 15. LOAD BALANCING  Dedicated hardware vs. software based – Price  HA proxy  Nginx (HTTPS termination)  LVS (direct routing)  DNS loadbalance, Anycast (multi site)  Layer 4 vs. 7 NOW PLAYING SCALABILITY – BME 15 May 7, 2012
  • 16. SESSION  Sticky (shared)  Centralized – DB / NoSQL – Memcached  Cookie – Sysop will like you NOW PLAYING SCALABILITY – BME 16 May 7, 2012
  • 17. ASYNCHRONOUS OPERATIONS  Decoupling  Capacity handling  Node.js  Jobs – Gearman  Message queue – Q4M, RabbitMQ, ZeroMQ NOW PLAYING SCALABILITY – BME 17 May 7, 2012
  • 18. CHALLENGES OF THE WEB STACK  Web requests: – 200 requests / sec / server (peak)  Cache server requests: – 10,000 requests / sec / server (peak)  Social stream requests: – 15,000 requests / sec / server (peak)  Database requests: – 25,000 requests / sec / server (peak) NOW PLAYING SCALABILITY – BME 18 May 7, 2012
  • 19. WEB ARCHITECTURE DMZ SOLR SOLR Site Search cluster API GW SCM/Monitor Distributed 3rd party IRC cluster Remote Site Job manager Accelerator Web cluster Varnish Memcache NginX Load balancer Internet MogileFS users Storage Static cluster Site MQ API Main Social stream GW Logs, Stats cluster Facebook MMM Monitor Memcache Slave DB cluster Database cluster NOW PLAYING SCALABILITY – BME 19 May 7, 2012
  • 20. SOCIAL STREAM: UNDER THE HOOD Highlights  Generated 2.5M visits in the last 30 Social Stream UI Message days (the 20% of this is new visitor) storage  0.8-1.1M messages per day Web cluster  Justin Bieber has ~230k messages per day  Jonas Brothers concert: 10k messages per minute in peak  Peak: Q4M message queue Varnish/Nginx/ – 5k new connection / sec Redis slave – 15k requests / sec – 600 Mbit / sec Redis master Twitter Facebook AIM MySpace Mixi Approval buffer NOW PLAYING SCALABILITY – BME 20 May 7, 2012
  • 21. DEVELOPMENT BEST PRACTICES  Continuous integration – Automated builds – Unit tests – Acceptance test  TDD, (ADD, FDD ;))  Abstract branching (feature switch)  Code review, pair programming, topic experts  DevOps culture NOW PLAYING SCALABILITY – BME 21 May 7, 2012
  • 22. DEVOPS TOOLING  Provisioning  Configuration management (cfengine, chef, puppet)  Application deployment (capistrano, fabric)  Orchestrator (mcollective)  Monitoring (system/application level) – Nagios, Munin, Cacti, Graphite etc.  Supervisors (monit, god)  Log management/analysis NOW PLAYING SCALABILITY – BME 22 May 7, 2012
  • 23. DEVELOPMENT BEST PRACTICES  Visualizing – Graphite (StatsD, logster) – Custom dashboards with KPIs, alerting  Runtime vs. build time  Automated code deployment  Load testing (automated better)  MVC NOW PLAYING SCALABILITY – BME 23 May 7, 2012
  • 24. CONFIGURATION MANAGEMENT  Automation  Versioning  Accountability  Chef, Puppet – Same local dev environment NOW PLAYING SCALABILITY – BME 24 May 7, 2012
  • 25. CLOUD ENVIRONMENTS  Amazon, Google App Engine etc.  Early stage  Cost savings  Backup for peaks NOW PLAYING SCALABILITY – BME 25 May 7, 2012
  • 26. ORGANIZATIONAL BEST PRACTICES  Architect board  Scrum of scrum  Product board  WESK (who else should know)  Internal demos NOW PLAYING SCALABILITY – BME 26 May 7, 2012
  • 27. SOURCE CODE MANAGEMENT • • • • • • NOW PLAYING SCALABILITY – BME 27 May 7, 2012
  • 28. MONITORING Highlights Tools  Proprietary dashboard to • Munin: Several custom plugins oversee key system • Cacti: Mainly for network devices performance charts in one • Nagios: More than 1200 location checks, Active checks  Real-time information about • Monit: Ensuring that a given process streaming related runs and it doesn’t consume too much servers, web/cache resources, Active checks servers, database servers • Query watchdog: Automatically stops  Summary of the Nagios checks and reports excessive read queries  Ability to roll back for historic charts  Provides shortcut to system tools NOW PLAYING SCALABILITY – BME 28 May 7, 2012
  • 29. WHERE TO IMPROVE  English  Enjoy programming  Soft skills (communication, team working, presentation, cooperation, management, leadership, time management etc.)  Agile development methods (Scrum, Kanban)  Continuous learning (blogs, books, conferences, code)  Craftsmanship – Clean Coder, Agile Software Development, Martin Fowler books / signature series, The Mythical Man-Month, Code Complete, The Pragmatic Programmer, Peopleware, The Passionate Programmer NOW PLAYING SCALABILITY – BME 29 May 7, 2012
  • 30. WHERE TO IMPROVE  Network programming, protocols  Algorithms  DHT  Database  Big Data (Hadoop, HBase, Hive/Pig, BI tools etc.)  API design (REST, SOAP, oAuth etc.)  Playing with open source tools of big companies (Twitter, FB, Linkedin)  Blogging, taking part in open source projects  Learning different type of programming (e.g. functional) NOW PLAYING SCALABILITY – BME 30 May 7, 2012
  • 31. THANK YOU Questions? NOW PLAYING SCALABILITY – BME 31 May 7, 2012
  • 32. NOW PLAYING SCALABILITY – BME 32 May 7, 2012