SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Lessons Learned
  while building Wakoopa
Menno van der Sman
    Developer at Wakoopa
       since May 2007
Wakoopa is about
   software
PC   Mac
200
million
Does it scale?
Scaling the front is easy
Scaling the back is
      harder
Limits spawn creativity
One server


            at Railsmachine
sliced into staging, production and db

            MySQL 4.1
         Apache + Mongrel
Background queue
Lots of tools already

BackgroundRB, DelayedJob, Daemons etc
Rolling our own

           database based
         using script/runner
processing multiple items in one loop
     one cache update per loop
Smart queries
    UPDATE developers SET active_seconds = active_seconds + ...


INSERT INTO hourly_usage (...) VALUES (...) ON DUPLICATE KEY UPDATE
  active_seconds = active_seconds + ..., idle_seconds = idle_seconds + ...



                     Allows for concurrency
Size = rowsize x rows
     Make rowsize smaller
sometimes `id`
shouldn’t be the
  Primary Key
Enter
composite_primary_keys
Overrides default PK
    class HourlyUsage < ActiveRecord::Base
      set_primary_keys :user_id, :software_id, :used_at

      ...
    end




         Original idea by Dr Nic
 Enhanced for Rail 2.1 by Darrin Holst
  http://compositekeys.rubyforge.org/
Archive old data
 that’s not frequently used
HourlyUsage
                 to
          HourlyUsageStorage
SELECT ... FROM hourly_usage WHERE used_at < '...' INTO OUTFILE '/path/to/file'

 LOAD DATA INFILE '/path/to/file' REPLACE INTO TABLE hourly_usage_storage




                      avoids long locks
Upcoming
improvements
MySQL 5.1
              Partitioning
   CREATE TABLE hourly_usage_storage ( ... )
   PARTITION BY RANGE (software_id) (
      PARTITION p0 VALUES LESS THAN (...),
      PARTITION p1 VALUES LESS THAN (...),
      PARTITION p2 VALUES LESS THAN (...),
      PARTITION p3 VALUES LESS THAN (...),
      ....
      PARTITION pn VALUES LESS THAN MAXVALUE
   );


Makes ‘WHERE software_id = ...’ very fast


     Available in MySQL 5.1
And many more plans

Designing a new infrastructure

            MySQL 5.1
           Memcached
              Sphinx
             Rails 2.1
           Amazon EC2
Announcing a new blog

  Inside Wakoopa
   http://inside.wakoopa.com
Questions?
             or suggestions?



Looking for C++ and frontend awesomeness
        http://wakoopa.com/jobs
Lessons Learned at Wakoopa

Contenu connexe

Tendances

Tendances (20)

Advance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul IntiAdvance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul Inti
 
HashiCorp at Just Eat
HashiCorp at Just EatHashiCorp at Just Eat
HashiCorp at Just Eat
 
Scalr Demo
Scalr DemoScalr Demo
Scalr Demo
 
AWS Lambda at JUST EAT
AWS Lambda at JUST EATAWS Lambda at JUST EAT
AWS Lambda at JUST EAT
 
Sql installation
Sql installationSql installation
Sql installation
 
London Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in ProductionLondon Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in Production
 
Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual Machines
 
DynamoDB for PHP sessions
DynamoDB for PHP sessionsDynamoDB for PHP sessions
DynamoDB for PHP sessions
 
Automated Deployment with Capistrano
Automated Deployment with CapistranoAutomated Deployment with Capistrano
Automated Deployment with Capistrano
 
EXPERTALKS: Nov 2012 - Web Application Clustering
EXPERTALKS: Nov 2012 - Web Application ClusteringEXPERTALKS: Nov 2012 - Web Application Clustering
EXPERTALKS: Nov 2012 - Web Application Clustering
 
Cloudinit
CloudinitCloudinit
Cloudinit
 
Automating with Ansible
Automating with AnsibleAutomating with Ansible
Automating with Ansible
 
Ansible and AWS
Ansible and AWSAnsible and AWS
Ansible and AWS
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Hosting MongoDB & our experience with database as a service
Hosting MongoDB & our experience with database as a serviceHosting MongoDB & our experience with database as a service
Hosting MongoDB & our experience with database as a service
 
20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraForm
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in Swift
 
ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014
ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014
ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014
 
IaaS: Windows Azure Virtual Machines
IaaS: Windows Azure Virtual MachinesIaaS: Windows Azure Virtual Machines
IaaS: Windows Azure Virtual Machines
 

En vedette

Motörhead
MotörheadMotörhead
Motörhead
EirikVR
 
El Viol.Loncel Magic2
El Viol.Loncel Magic2El Viol.Loncel Magic2
El Viol.Loncel Magic2
a8002231
 
Nuevos Escenarios: tecnología, cultura y subjetividad
Nuevos Escenarios: tecnología, cultura y subjetividadNuevos Escenarios: tecnología, cultura y subjetividad
Nuevos Escenarios: tecnología, cultura y subjetividad
DaliaGut
 
Talle rtic s
Talle rtic sTalle rtic s
Talle rtic s
Anel Sosa
 

En vedette (19)

Wakoopa Recommendation Engine on AWS
Wakoopa Recommendation Engine on AWSWakoopa Recommendation Engine on AWS
Wakoopa Recommendation Engine on AWS
 
Ams.rb Oktober
Ams.rb OktoberAms.rb Oktober
Ams.rb Oktober
 
Introduction to Rails
Introduction to RailsIntroduction to Rails
Introduction to Rails
 
A Kirkbride visual CV 2013
A Kirkbride visual CV 2013A Kirkbride visual CV 2013
A Kirkbride visual CV 2013
 
Motörhead
MotörheadMotörhead
Motörhead
 
When Change Fails
When Change FailsWhen Change Fails
When Change Fails
 
Jaja
JajaJaja
Jaja
 
7 phases of pain
7 phases of pain7 phases of pain
7 phases of pain
 
El Viol.Loncel Magic2
El Viol.Loncel Magic2El Viol.Loncel Magic2
El Viol.Loncel Magic2
 
育英國中校園資訊環境簡介
育英國中校園資訊環境簡介育英國中校園資訊環境簡介
育英國中校園資訊環境簡介
 
Juan
JuanJuan
Juan
 
部落格
部落格部落格
部落格
 
Nuevos Escenarios: tecnología, cultura y subjetividad
Nuevos Escenarios: tecnología, cultura y subjetividadNuevos Escenarios: tecnología, cultura y subjetividad
Nuevos Escenarios: tecnología, cultura y subjetividad
 
Talle rtic s
Talle rtic sTalle rtic s
Talle rtic s
 
Talle rtic s
Talle rtic sTalle rtic s
Talle rtic s
 
Presentación1
Presentación1Presentación1
Presentación1
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 

Similaire à Lessons Learned at Wakoopa

Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 

Similaire à Lessons Learned at Wakoopa (20)

Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
MySQL on Docker and Kubernetes
MySQL on Docker and KubernetesMySQL on Docker and Kubernetes
MySQL on Docker and Kubernetes
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with Kubernetes
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
 
Ipc mysql php
Ipc mysql php Ipc mysql php
Ipc mysql php
 
Couch base
Couch baseCouch base
Couch base
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvars
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 
Apache Spark Workshop, Apr. 2016, Euangelos Linardos
Apache Spark Workshop, Apr. 2016, Euangelos LinardosApache Spark Workshop, Apr. 2016, Euangelos Linardos
Apache Spark Workshop, Apr. 2016, Euangelos Linardos
 
Hue: Big Data Web applications for Interactive Hadoop at Big Data Spain 2014
Hue: Big Data Web applications for Interactive Hadoop at Big Data Spain 2014Hue: Big Data Web applications for Interactive Hadoop at Big Data Spain 2014
Hue: Big Data Web applications for Interactive Hadoop at Big Data Spain 2014
 
How to Contribute Code to MySQL?
How to Contribute Code to MySQL?How to Contribute Code to MySQL?
How to Contribute Code to MySQL?
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
Migrating existing open source machine learning to azure
Migrating existing open source machine learning to azureMigrating existing open source machine learning to azure
Migrating existing open source machine learning to azure
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Scaling up Near Real-time Analytics @Uber &LinkedIn
Scaling up Near Real-time Analytics @Uber &LinkedInScaling up Near Real-time Analytics @Uber &LinkedIn
Scaling up Near Real-time Analytics @Uber &LinkedIn
 
Migrating Existing Open Source Machine Learning to Azure
Migrating Existing Open Source Machine Learning to AzureMigrating Existing Open Source Machine Learning to Azure
Migrating Existing Open Source Machine Learning to Azure
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
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
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Lessons Learned at Wakoopa

  • 1.
  • 2. Lessons Learned while building Wakoopa
  • 3. Menno van der Sman Developer at Wakoopa since May 2007
  • 5.
  • 6. PC Mac
  • 10. Scaling the back is harder
  • 12. One server at Railsmachine sliced into staging, production and db MySQL 4.1 Apache + Mongrel
  • 14. Lots of tools already BackgroundRB, DelayedJob, Daemons etc
  • 15. Rolling our own database based using script/runner processing multiple items in one loop one cache update per loop
  • 16. Smart queries UPDATE developers SET active_seconds = active_seconds + ... INSERT INTO hourly_usage (...) VALUES (...) ON DUPLICATE KEY UPDATE active_seconds = active_seconds + ..., idle_seconds = idle_seconds + ... Allows for concurrency
  • 17. Size = rowsize x rows Make rowsize smaller
  • 20. Overrides default PK class HourlyUsage < ActiveRecord::Base set_primary_keys :user_id, :software_id, :used_at ... end Original idea by Dr Nic Enhanced for Rail 2.1 by Darrin Holst http://compositekeys.rubyforge.org/
  • 21. Archive old data that’s not frequently used
  • 22. HourlyUsage to HourlyUsageStorage SELECT ... FROM hourly_usage WHERE used_at < '...' INTO OUTFILE '/path/to/file' LOAD DATA INFILE '/path/to/file' REPLACE INTO TABLE hourly_usage_storage avoids long locks
  • 24. MySQL 5.1 Partitioning CREATE TABLE hourly_usage_storage ( ... ) PARTITION BY RANGE (software_id) ( PARTITION p0 VALUES LESS THAN (...), PARTITION p1 VALUES LESS THAN (...), PARTITION p2 VALUES LESS THAN (...), PARTITION p3 VALUES LESS THAN (...), .... PARTITION pn VALUES LESS THAN MAXVALUE ); Makes ‘WHERE software_id = ...’ very fast Available in MySQL 5.1
  • 25. And many more plans Designing a new infrastructure MySQL 5.1 Memcached Sphinx Rails 2.1 Amazon EC2
  • 26. Announcing a new blog Inside Wakoopa http://inside.wakoopa.com
  • 27. Questions? or suggestions? Looking for C++ and frontend awesomeness http://wakoopa.com/jobs