SlideShare a Scribd company logo
Building a Scalable Online Backup System in PythonJoe Drumgoolehttp://twitter/jdrumgoole
ScalingYou probably shouldn’t careThroughput vs response timeScaling is a fractal problemThe database is what will get ya!Amazing what a well tuned DB will supporthttp://twitter.com/jdrumgoole2
PutPlace Architecturehttp://twitter.com/jdrumgoole3
Online BackupNot really a Web 2.0 playMore like client serverLarger vision of PutPlaceMap of your Digital Worldhttp://twitter.com/jdrumgoole4
Online Backup : ClientInstallation and support of Windows 20**Mac SupportOpen file/locked file handlingBandwidth throttlingCPU ThrottlingUpload restartsFeedbackhttp://twitter.com/jdrumgoole5
Online Backup : ServerDon’t loose any filesDe-duplicationThumbnail generation for imagesFlickr BackupClient FeedbackBulk downloadFile relationshipshttp://twitter.com/jdrumgoole6
Online Backup - SecretsPeople Don’t backupCompute dominatesRestores represent 0.01% of bandwidth and loadWriting web clones of Windows Explorer is hardThe browser sucks as a client side app container (for now)http://twitter.com/jdrumgoole7
ScalingFor online backup the challenge is to receive shed loads of data from lots of clientsClients upload in 1MB chunksChunks must be stored coalesced and push to stable backup (S3)Clients must get acknowledgementWeb page must updateQuota managementhttp://twitter.com/jdrumgoole8
Load BalancerLoad Balancer : Perlbalhttp://www.danga.com/perlbal/Can handle 100 x millions of requests per dayEvent based(sshhh : Don’t tell anyone, but its Perl!)It does fall over occasionallyOtherwise works perfectlyhttp://twitter.com/jdrumgoole9
App ServerOur app servers:Handle loginDeliver web pagesHandle uploads from clientsHand off heavy duty processing to task serversThumbnail generationFile coalescingChecksum generationHand off is via a database queuehttp://twitter.com/jdrumgoole10
App ServerJust Django InstancesTemplates deliver web pagesViews handle chunks/login etc.Models update the databaseTask Servers do the heavy liftinghttp://twitter.com/jdrumgoole11
Task ServerRun off a database queue (table)Four main task servers:Assemble completed file uploadsCreate thumbnailsRemove deleted filesGenerate user statisticsServers are multi-threadedhttp://twitter.com/jdrumgoole12
RefactoringOriginally N blacknight servers writing to NFSThen N blacknight servers writing to S3Then N EC2 servers writing to S3The N EC2 servers writing to MogileFS/S3Lots of uploading optimisations along the wayhttp://twitter.com/jdrumgoole13
ResultsSystem has successfully uploaded over 100k files in a single dayRegularily does 50k files a dayHave about 2k registered usersContinues to get registrationsRuns in lights out mode (no daily/weekly/monthly housekeeping)http://twitter.com/jdrumgoole14
What workedPython proved extremely flexibleStandard library saved us lots of workDjango provided a lot of glueEasy to  migrate from dedicated host on NFS to Cloud Hosting and S3 storageNagios/Monitis monitoringhttp://twitter.com/jdrumgoole15
What Didn’t WorkWould use MySQL rather than PostgresEasier to cluster, more knowledge availableNative Windows ClientUnecessary, Python client was good enoughWould use an off the shelf queueing systemRabbitMQ, ActiveMQ, SQSKludgey client side APIThreading The Clienthttp://twitter.com/jdrumgoole16
Tool ChainWush.net 		: Subversion and TracDynDNS: Dynamic DNSPython/Django: Dev StackPostgres: DatabaseHudson		: Build ServerPerlbal: Load BalancingMogileFS		: Distributed File SystemMemcached 		: CachingNagios, Monitis: MonitoringHamachi		: VPN through FirewallGoogle Apps	: Email, Calendar, Docs, WikiAuthSMTP		: Validated SMTPZendesk: Support DeskAmazon		: Storage, Compute, BandwidthPaypal		: Billinghttp://twitter.com/jdrumgoole17
CostsCapital ExpenditureOne server 5k euroOne laptop per developer 2.5k (7 devs)One Linksys WIFI/Firewall (won at Raffle)Two 24 port switches 1.6kTotal: ~24kRunning Costs for Grid and Storage~1800 euro a month (8 instances)http://twitter.com/jdrumgoole18
If I Were Doing it AgainStick with native python clientLook at eventing ala Node.js for serverUse MySQLUse Google App Engine as Front End/Load BalancerUse a commercial queueing packagehttp://twitter.com/jdrumgoole19
ThanksQ&Ahttp://twitter.com/jdrumgoole20

More Related Content

PDF
HTTP2 is Here!
PDF
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
PDF
HTTP/2 What's inside and Why
PDF
What HTTP/2.0 Will Do For You
ODP
Choosing a Web Architecture for Perl
PDF
PPTX
Altitude San Francisco 2018: Testing with Fastly Workshop
 
PDF
Comet: Making The Web a 2-Way Medium
HTTP2 is Here!
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP/2 What's inside and Why
What HTTP/2.0 Will Do For You
Choosing a Web Architecture for Perl
Altitude San Francisco 2018: Testing with Fastly Workshop
 
Comet: Making The Web a 2-Way Medium

What's hot (20)

PPTX
Altitude San Francisco 2018: Programming the Edge
 
PDF
4.2. Web analyst fiddler
PDF
HTTP/2 Update - FOSDEM 2016
KEY
I got 99 problems, but ReST ain't one
PPTX
Service workers: what and why UmbUKFest 2018!
PDF
Efficient HTTP Apis
PPTX
Background Processing - PyCon MY 2015
PPTX
Debugging with Fiddler
ZIP
Websockets at tossug
 
PDF
HTTP colon slash slash: the end of the road?
PPTX
HTTP/2 for Developers
PPTX
Introduction to HTTP/2
PDF
HTTP 2.0 – What do I need to know?
PPTX
Web sockets in Java
PPTX
JS digest. Decemebr 2017
PDF
HTTP 2.0 Why, How and When
PPTX
HTTP/2 Introduction
PDF
Search in WordPress - how it works and howto customize it
PPTX
Getting the most out of WebPageTest
PPT
Scaling my sql_in_3d
Altitude San Francisco 2018: Programming the Edge
 
4.2. Web analyst fiddler
HTTP/2 Update - FOSDEM 2016
I got 99 problems, but ReST ain't one
Service workers: what and why UmbUKFest 2018!
Efficient HTTP Apis
Background Processing - PyCon MY 2015
Debugging with Fiddler
Websockets at tossug
 
HTTP colon slash slash: the end of the road?
HTTP/2 for Developers
Introduction to HTTP/2
HTTP 2.0 – What do I need to know?
Web sockets in Java
JS digest. Decemebr 2017
HTTP 2.0 Why, How and When
HTTP/2 Introduction
Search in WordPress - how it works and howto customize it
Getting the most out of WebPageTest
Scaling my sql_in_3d
Ad

Similar to Building a scalable online backup system in python (20)

PDF
Getting a Grip on CDN Performance - Why and How
PDF
Download full ebook of Mastering NGINX Dimitri Aivaliotis instant download pdf
PDF
Http/2 - What's it all about?
PDF
The Case for HTTP/2 - Internetdagarna 2015 - Stockholm
PPTX
Cloud Computing
PDF
REST in peace @ IPC 2012 in Mainz
PDF
Web performance Part 1 "Networking theoretical basis"
PDF
The case for HTTP/2
PDF
The Case for HTTP/2 - GreeceJS - June 2016
PPT
EQR Reporting: Rails + Amazon EC2
PPTX
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
PDF
Optimising Web Application Frontend
PPTX
Final Presentation
PPT
Make Drupal Run Fast - increase page load speed
PDF
On-Demand Image Resizing Extended - External Meet-up
PDF
data.table and H2O at LondonR with Matt Dowle
PDF
Meetup Tech Talk on Web Performance
PDF
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
PPT
Make Drupal Run Fast - increase page load speed
PDF
PostgreSQL Server Programming Second Edition Usama Dar Hannu Krosing Jim Mlod...
Getting a Grip on CDN Performance - Why and How
Download full ebook of Mastering NGINX Dimitri Aivaliotis instant download pdf
Http/2 - What's it all about?
The Case for HTTP/2 - Internetdagarna 2015 - Stockholm
Cloud Computing
REST in peace @ IPC 2012 in Mainz
Web performance Part 1 "Networking theoretical basis"
The case for HTTP/2
The Case for HTTP/2 - GreeceJS - June 2016
EQR Reporting: Rails + Amazon EC2
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
Optimising Web Application Frontend
Final Presentation
Make Drupal Run Fast - increase page load speed
On-Demand Image Resizing Extended - External Meet-up
data.table and H2O at LondonR with Matt Dowle
Meetup Tech Talk on Web Performance
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
Make Drupal Run Fast - increase page load speed
PostgreSQL Server Programming Second Edition Usama Dar Hannu Krosing Jim Mlod...
Ad

More from Joe Drumgoole (20)

PPTX
MongoDB Schema Design
PPTX
The Rise of Microservices
PPTX
Back to Basics 2017 - Your First MongoDB Application
PPTX
Back to Basics 2017 - Introduction to NoSQL
PPTX
Python Ireland Conference 2016 - Python and MongoDB Workshop
PPTX
Server discovery and monitoring with MongoDB
PPTX
Event sourcing the best ubiquitous pattern you have never heard off
PPTX
EuroPython 2016 : A Deep Dive into the Pymongo Driver
PPTX
MongoDB World 2016 : Advanced Aggregation
PPTX
Introduction to NoSQL
PPTX
Introduction to CQRS and Event Sourcing
PPTX
Back to Basics Webinar 3 - Thinking in Documents
PPTX
Back to Basics Webinar 2 - Your First MongoDB Application
PPTX
Back to Basics Webinar 1 - Introduction to NoSQL
PPTX
Cloud Computing - Halfway through the revolution
PPTX
Enterprise mobility for fun and profit
PPTX
How to run a company for 2k a year
PPTX
Mobile monday mhealth
PPTX
Cloudsplit original
PPTX
Harness the web and grow your business
MongoDB Schema Design
The Rise of Microservices
Back to Basics 2017 - Your First MongoDB Application
Back to Basics 2017 - Introduction to NoSQL
Python Ireland Conference 2016 - Python and MongoDB Workshop
Server discovery and monitoring with MongoDB
Event sourcing the best ubiquitous pattern you have never heard off
EuroPython 2016 : A Deep Dive into the Pymongo Driver
MongoDB World 2016 : Advanced Aggregation
Introduction to NoSQL
Introduction to CQRS and Event Sourcing
Back to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 2 - Your First MongoDB Application
Back to Basics Webinar 1 - Introduction to NoSQL
Cloud Computing - Halfway through the revolution
Enterprise mobility for fun and profit
How to run a company for 2k a year
Mobile monday mhealth
Cloudsplit original
Harness the web and grow your business

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Cloud computing and distributed systems.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
 
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
 
PDF
KodekX | Application Modernization Development
 
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Cloud computing and distributed systems.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
The AUB Centre for AI in Media Proposal.docx
 
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
 
KodekX | Application Modernization Development
 

Building a scalable online backup system in python

  • 1. Building a Scalable Online Backup System in PythonJoe Drumgoolehttp://twitter/jdrumgoole
  • 2. ScalingYou probably shouldn’t careThroughput vs response timeScaling is a fractal problemThe database is what will get ya!Amazing what a well tuned DB will supporthttp://twitter.com/jdrumgoole2
  • 4. Online BackupNot really a Web 2.0 playMore like client serverLarger vision of PutPlaceMap of your Digital Worldhttp://twitter.com/jdrumgoole4
  • 5. Online Backup : ClientInstallation and support of Windows 20**Mac SupportOpen file/locked file handlingBandwidth throttlingCPU ThrottlingUpload restartsFeedbackhttp://twitter.com/jdrumgoole5
  • 6. Online Backup : ServerDon’t loose any filesDe-duplicationThumbnail generation for imagesFlickr BackupClient FeedbackBulk downloadFile relationshipshttp://twitter.com/jdrumgoole6
  • 7. Online Backup - SecretsPeople Don’t backupCompute dominatesRestores represent 0.01% of bandwidth and loadWriting web clones of Windows Explorer is hardThe browser sucks as a client side app container (for now)http://twitter.com/jdrumgoole7
  • 8. ScalingFor online backup the challenge is to receive shed loads of data from lots of clientsClients upload in 1MB chunksChunks must be stored coalesced and push to stable backup (S3)Clients must get acknowledgementWeb page must updateQuota managementhttp://twitter.com/jdrumgoole8
  • 9. Load BalancerLoad Balancer : Perlbalhttp://www.danga.com/perlbal/Can handle 100 x millions of requests per dayEvent based(sshhh : Don’t tell anyone, but its Perl!)It does fall over occasionallyOtherwise works perfectlyhttp://twitter.com/jdrumgoole9
  • 10. App ServerOur app servers:Handle loginDeliver web pagesHandle uploads from clientsHand off heavy duty processing to task serversThumbnail generationFile coalescingChecksum generationHand off is via a database queuehttp://twitter.com/jdrumgoole10
  • 11. App ServerJust Django InstancesTemplates deliver web pagesViews handle chunks/login etc.Models update the databaseTask Servers do the heavy liftinghttp://twitter.com/jdrumgoole11
  • 12. Task ServerRun off a database queue (table)Four main task servers:Assemble completed file uploadsCreate thumbnailsRemove deleted filesGenerate user statisticsServers are multi-threadedhttp://twitter.com/jdrumgoole12
  • 13. RefactoringOriginally N blacknight servers writing to NFSThen N blacknight servers writing to S3Then N EC2 servers writing to S3The N EC2 servers writing to MogileFS/S3Lots of uploading optimisations along the wayhttp://twitter.com/jdrumgoole13
  • 14. ResultsSystem has successfully uploaded over 100k files in a single dayRegularily does 50k files a dayHave about 2k registered usersContinues to get registrationsRuns in lights out mode (no daily/weekly/monthly housekeeping)http://twitter.com/jdrumgoole14
  • 15. What workedPython proved extremely flexibleStandard library saved us lots of workDjango provided a lot of glueEasy to migrate from dedicated host on NFS to Cloud Hosting and S3 storageNagios/Monitis monitoringhttp://twitter.com/jdrumgoole15
  • 16. What Didn’t WorkWould use MySQL rather than PostgresEasier to cluster, more knowledge availableNative Windows ClientUnecessary, Python client was good enoughWould use an off the shelf queueing systemRabbitMQ, ActiveMQ, SQSKludgey client side APIThreading The Clienthttp://twitter.com/jdrumgoole16
  • 17. Tool ChainWush.net : Subversion and TracDynDNS: Dynamic DNSPython/Django: Dev StackPostgres: DatabaseHudson : Build ServerPerlbal: Load BalancingMogileFS : Distributed File SystemMemcached : CachingNagios, Monitis: MonitoringHamachi : VPN through FirewallGoogle Apps : Email, Calendar, Docs, WikiAuthSMTP : Validated SMTPZendesk: Support DeskAmazon : Storage, Compute, BandwidthPaypal : Billinghttp://twitter.com/jdrumgoole17
  • 18. CostsCapital ExpenditureOne server 5k euroOne laptop per developer 2.5k (7 devs)One Linksys WIFI/Firewall (won at Raffle)Two 24 port switches 1.6kTotal: ~24kRunning Costs for Grid and Storage~1800 euro a month (8 instances)http://twitter.com/jdrumgoole18
  • 19. If I Were Doing it AgainStick with native python clientLook at eventing ala Node.js for serverUse MySQLUse Google App Engine as Front End/Load BalancerUse a commercial queueing packagehttp://twitter.com/jdrumgoole19