SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Scalable architecture




                By Adam Brodziak
                Global Sports Media b.v.
Abstract

   Adam Brodziak


An overview of modern web-based application
architecture - from hardware infrastructure,
through PHP/SQL code, HTML/CSS markup
distribution. All of this spiced up by cache,
loadbalancing and CDN.
Who is this guy?

   Lead developer at Global Sports Media
       GSM collects and process sports data
       GSM owns soccerway.com portal
   Linux user
   Interested in frameworks, design patterns
   Semantic Web enthousiast
   Football (soccer) fan
Topics

   The Challenge
   Infrastructure
   Code
   Cache
   CDN
Topics

   The Challenge
   Infrastructure
   Code
   Cache
   CDN
Raw numbers

   7 millions visits / month
   52 millions pageviews / month
   1 billion request / month
   6TB of traffic / month
   300k users at peak time
   Quite a few clients using the same hardware
Not so much, but...

                     700 leagues
                     Livescores
                     Game events
                     Match statistics
                     Rankings
                     Editorials
Traffic growth
The Challenge

   Loads of data to process
       Scores
       Events
       Stats
   In real-time (livescores)
   Growing number of visitors
   13K hits/sec at peak-time
10 servers to run it all
Topics

   The Challenge
   Infrastructure
   Code
   Cache
   CDN
It starts with one
Load balancing
Loadbalancing caveats

   Don't relay on the local filesystem
       Temporary files, session, logs
   Avoid assuming exclusive/single cache
       APC, Zend Cache
   Use distributed session storage
       Memcache, database
   Encalsulate above
Separate database server
DB replication
Replicaton caveats

   Writes only on master
   Reads from slaves
   Data consistency
   Replication lag
       Don't do
$master->query('UPDATE session SET logged = 1');
$slave->query('SELECT logged FROM session');
Whole image
Topics

   The Challenge
   Infrastructure
   Code
   Cache
   CDN
PHP is slow!

   Yes, but it does not matter!
   Database access is slower
   Cache over network is slower
   Disk access is slower
   HTTP requests are slower
   Webservice calls are slower
   Discover bottlenecks before blaming PHP
It's about architecture

   Heavy tasks in background
       CRON, Gearman
   Pregenerate stuff
   Move some code to SQL
       Calculations in queries
       Stored procedures
       Triggers
   C/C++ or Java for heavy computation
   Use PHP to glue it together
PHP Frameworks




   Hundreds of others
   Which one to choose?
Framework? Think again!

   Raw performance matters
   Support for master-slave replication
   Multiple layers of cache
   Working with accelerators (HipHop!)
   Beware of bottlenecks
       i.e. core part of framework is slow
   Designed to scale
Topics

   The Challenge
   Infrastructure
   Code
   Cache
   CDN
Cache is everywhere

   CPU: L1, L2
   Disk buffer
   Linux filesystem
   MySQL
   PHP (APC)
   Smarty
   HTTP Proxy
   Browser cache
Where to cache?
Memory is cheap

   Pre-generate stuff
   Store results in memory
       APC, memcached
   App config in memory
       APC with stat=off
   Increase RAM for MySQL
   Disk is the new tape
Memcached for the rescue!

   Dead simple
   Key-value
   Distributed storage pool
   Automatic invalidation after X sec
       No garbage collecting invoked
   Store arrays, objects, simple values
   Easy integration
Topics

   The Challenge
   Infrastructure
   Code
   Cache
   CDN
Reverse-proxy

   First line of cache
   Returns content if resource is up-to-date
   Works on HTTP level
       Can be integrated into existing infrastructure
   Can do load balancing
   In-memory cache storage
   Squid, Nginx, Varnish
Content Delivery Network

   Network of servers
   Worldwide
   Automatic loadbalancing
   Fast access (low ping time)
   Data redundancy gratis
   Ideal for static resources
       But not only
   Must-have for worldwide websites
CDN as reverse-proxy

   HTTP request / response chain
   Embraces REST architecture
   Requests are distributed
   Reduces latency
   Lowers traffic volume
   Increases availability
   i.e. Akamai Edge Suite
CDN at soccerway.com

   All of the content is served via CDN
       Images, CSS, JS
       Generated HTML
       JSON for Ajax
   90% of traffic via CDN
   Origin requests only from Europe
   Site online even if servers are down
   Can't live without ;)
Thank you for listening




             Questions?
Interested?

   Contact me:
       adam@globalsportsmedia.com
       www.goldenline.pl/adam-brodziak
       www.linkedin.com/in/adambrodziak
   We're hiring!
       Web developers
       Football / sport fans

Weitere ähnliche Inhalte

Was ist angesagt?

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparisonRohit Kelapure
 
Simple server side cache for Express.js with Node.js
Simple server side cache for Express.js with Node.jsSimple server side cache for Express.js with Node.js
Simple server side cache for Express.js with Node.jsGokusen Newz
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sitesdrupalcampest
 
WiredTiger Overview
WiredTiger OverviewWiredTiger Overview
WiredTiger OverviewWiredTiger
 
Caching for J2ee Enterprise Applications
Caching for J2ee Enterprise ApplicationsCaching for J2ee Enterprise Applications
Caching for J2ee Enterprise ApplicationsDebajani Mohanty
 
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionAdvanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionColdFusionConference
 
wordpress-performance-presentation
wordpress-performance-presentationwordpress-performance-presentation
wordpress-performance-presentationArun Janarthanan
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QADenis Dudaev
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimizationShafqat Hussain
 
A Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerA Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerMongoDB
 
Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceSpark::red
 
Optimizing Client-Side Performance
Optimizing Client-Side PerformanceOptimizing Client-Side Performance
Optimizing Client-Side Performanceandrew4web
 

Was ist angesagt? (17)

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
 
Simple server side cache for Express.js with Node.js
Simple server side cache for Express.js with Node.jsSimple server side cache for Express.js with Node.js
Simple server side cache for Express.js with Node.js
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
WiredTiger Overview
WiredTiger OverviewWiredTiger Overview
WiredTiger Overview
 
Caching for J2ee Enterprise Applications
Caching for J2ee Enterprise ApplicationsCaching for J2ee Enterprise Applications
Caching for J2ee Enterprise Applications
 
Redis vs Memcached
Redis vs MemcachedRedis vs Memcached
Redis vs Memcached
 
Caching
CachingCaching
Caching
 
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionAdvanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
 
Web performance Talk
Web performance TalkWeb performance Talk
Web performance Talk
 
wordpress-performance-presentation
wordpress-performance-presentationwordpress-performance-presentation
wordpress-performance-presentation
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QA
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimization
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
Azure Redis Cache
Azure Redis CacheAzure Redis Cache
Azure Redis Cache
 
A Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerA Technical Introduction to WiredTiger
A Technical Introduction to WiredTiger
 
Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web Perormance
 
Optimizing Client-Side Performance
Optimizing Client-Side PerformanceOptimizing Client-Side Performance
Optimizing Client-Side Performance
 

Andere mochten auch

The english language can be a 'killer' at time
The english language can be a 'killer' at timeThe english language can be a 'killer' at time
The english language can be a 'killer' at timeNam Talae
 
Sintesis informativa 01 04 2013
Sintesis informativa 01 04 2013Sintesis informativa 01 04 2013
Sintesis informativa 01 04 2013megaradioexpress
 
Media Funding and Sustainabilty
Media Funding and SustainabiltyMedia Funding and Sustainabilty
Media Funding and SustainabiltyLevi Kabwato
 
VCAT Case Study re Insurance Obligations Melbourne / Victoria
VCAT Case Study re Insurance Obligations Melbourne / VictoriaVCAT Case Study re Insurance Obligations Melbourne / Victoria
VCAT Case Study re Insurance Obligations Melbourne / VictoriaTEYS Lawyers
 
DevOps @ InterOP Las Vegas - Jesse Robbins - Opscode
DevOps @ InterOP Las Vegas - Jesse Robbins - OpscodeDevOps @ InterOP Las Vegas - Jesse Robbins - Opscode
DevOps @ InterOP Las Vegas - Jesse Robbins - OpscodeJesse Robbins
 

Andere mochten auch (7)

The english language can be a 'killer' at time
The english language can be a 'killer' at timeThe english language can be a 'killer' at time
The english language can be a 'killer' at time
 
Sintesis informativa 01 04 2013
Sintesis informativa 01 04 2013Sintesis informativa 01 04 2013
Sintesis informativa 01 04 2013
 
Media Funding and Sustainabilty
Media Funding and SustainabiltyMedia Funding and Sustainabilty
Media Funding and Sustainabilty
 
UNIV495
UNIV495UNIV495
UNIV495
 
VCAT Case Study re Insurance Obligations Melbourne / Victoria
VCAT Case Study re Insurance Obligations Melbourne / VictoriaVCAT Case Study re Insurance Obligations Melbourne / Victoria
VCAT Case Study re Insurance Obligations Melbourne / Victoria
 
Team1Samadhan
Team1SamadhanTeam1Samadhan
Team1Samadhan
 
DevOps @ InterOP Las Vegas - Jesse Robbins - Opscode
DevOps @ InterOP Las Vegas - Jesse Robbins - OpscodeDevOps @ InterOP Las Vegas - Jesse Robbins - Opscode
DevOps @ InterOP Las Vegas - Jesse Robbins - Opscode
 

Ähnlich wie Skalowalna architektura na przykładzie soccerway.com

Experience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewExperience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewPhuwadon D
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningBrian Huff
 
Building scalable and reliable websites
Building scalable and reliable websitesBuilding scalable and reliable websites
Building scalable and reliable websitesTomasz Zen Napierala
 
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...Michael Stack
 
How to Scale to Millions of Users with AWS
How to Scale to Millions of Users with AWSHow to Scale to Millions of Users with AWS
How to Scale to Millions of Users with AWSAmazon Web Services
 
Building Scalable .NET Web Applications
Building Scalable .NET Web ApplicationsBuilding Scalable .NET Web Applications
Building Scalable .NET Web ApplicationsBuu Nguyen
 
Speeding up your Drupal site
Speeding up your Drupal siteSpeeding up your Drupal site
Speeding up your Drupal siteRonan Berder
 
How to build CDN for your website
How to build CDN for your websiteHow to build CDN for your website
How to build CDN for your websiteMartin Kulov
 
Optimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp HoustonOptimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp HoustonChris Olbekson
 
Crimson: Ceph for the Age of NVMe and Persistent Memory
Crimson: Ceph for the Age of NVMe and Persistent MemoryCrimson: Ceph for the Age of NVMe and Persistent Memory
Crimson: Ceph for the Age of NVMe and Persistent MemoryScyllaDB
 
Web Performance & Scalability Tools
Web Performance & Scalability ToolsWeb Performance & Scalability Tools
Web Performance & Scalability ToolsFolio3 Software
 
Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...
Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...
Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...Ontico
 
Get started With Microsoft Azure Virtual Machine
Get started With Microsoft Azure Virtual MachineGet started With Microsoft Azure Virtual Machine
Get started With Microsoft Azure Virtual MachineLai Yoong Seng
 
Building Low Cost Scalable Web Applications Tools & Techniques
Building Low Cost Scalable Web Applications   Tools & TechniquesBuilding Low Cost Scalable Web Applications   Tools & Techniques
Building Low Cost Scalable Web Applications Tools & Techniquesrramesh
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop User Group
 
Caching Methodology & Strategies
Caching Methodology & StrategiesCaching Methodology & Strategies
Caching Methodology & StrategiesTiệp Vũ
 

Ähnlich wie Skalowalna architektura na przykładzie soccerway.com (20)

Experience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewExperience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's View
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
 
Building scalable and reliable websites
Building scalable and reliable websitesBuilding scalable and reliable websites
Building scalable and reliable websites
 
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...
 
How to Scale to Millions of Users with AWS
How to Scale to Millions of Users with AWSHow to Scale to Millions of Users with AWS
How to Scale to Millions of Users with AWS
 
Building Scalable .NET Web Applications
Building Scalable .NET Web ApplicationsBuilding Scalable .NET Web Applications
Building Scalable .NET Web Applications
 
Speeding up your Drupal site
Speeding up your Drupal siteSpeeding up your Drupal site
Speeding up your Drupal site
 
How to build CDN for your website
How to build CDN for your websiteHow to build CDN for your website
How to build CDN for your website
 
Optimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp HoustonOptimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp Houston
 
Crimson: Ceph for the Age of NVMe and Persistent Memory
Crimson: Ceph for the Age of NVMe and Persistent MemoryCrimson: Ceph for the Age of NVMe and Persistent Memory
Crimson: Ceph for the Age of NVMe and Persistent Memory
 
Web Performance & Scalability Tools
Web Performance & Scalability ToolsWeb Performance & Scalability Tools
Web Performance & Scalability Tools
 
Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...
Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...
Как Web-акселератор акселерирует ваш сайт / Александр Крижановский (Tempesta ...
 
Get started With Microsoft Azure Virtual Machine
Get started With Microsoft Azure Virtual MachineGet started With Microsoft Azure Virtual Machine
Get started With Microsoft Azure Virtual Machine
 
Building Low Cost Scalable Web Applications Tools & Techniques
Building Low Cost Scalable Web Applications   Tools & TechniquesBuilding Low Cost Scalable Web Applications   Tools & Techniques
Building Low Cost Scalable Web Applications Tools & Techniques
 
Scalable Web Architecture
Scalable Web ArchitectureScalable Web Architecture
Scalable Web Architecture
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
 
Caching Methodology & Strategies
Caching Methodology & StrategiesCaching Methodology & Strategies
Caching Methodology & Strategies
 

Mehr von Spodek 2.0

Rentowna strona ecommerce przy 20 użytkownikach dziennie
Rentowna strona ecommerce przy 20 użytkownikach dziennieRentowna strona ecommerce przy 20 użytkownikach dziennie
Rentowna strona ecommerce przy 20 użytkownikach dziennieSpodek 2.0
 
Pozyskiwanie inwestora na przykładzie ServeCloud.pl
Pozyskiwanie inwestora na przykładzie ServeCloud.plPozyskiwanie inwestora na przykładzie ServeCloud.pl
Pozyskiwanie inwestora na przykładzie ServeCloud.plSpodek 2.0
 
Marketingowy geniusz Lady GaGi
Marketingowy geniusz Lady GaGiMarketingowy geniusz Lady GaGi
Marketingowy geniusz Lady GaGiSpodek 2.0
 
Empathy optymalizacja postgre_sql
Empathy optymalizacja postgre_sqlEmpathy optymalizacja postgre_sql
Empathy optymalizacja postgre_sqlSpodek 2.0
 
Co internet namieszał w budowaniu marki, czyli jak tworzyć fanbojów
Co internet namieszał w budowaniu marki, czyli jak tworzyć fanbojówCo internet namieszał w budowaniu marki, czyli jak tworzyć fanbojów
Co internet namieszał w budowaniu marki, czyli jak tworzyć fanbojówSpodek 2.0
 
Usability - narzędzia niskobudżetowe, z których warto i nie warto korzystać
Usability - narzędzia niskobudżetowe, z których warto i nie warto korzystaćUsability - narzędzia niskobudżetowe, z których warto i nie warto korzystać
Usability - narzędzia niskobudżetowe, z których warto i nie warto korzystaćSpodek 2.0
 
Obowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowych
Obowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowychObowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowych
Obowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowychSpodek 2.0
 
NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?
NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?
NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?Spodek 2.0
 
Startup School okiem uczestnika. O 3 miesiącach pracy nad Animili
Startup School okiem uczestnika. O 3 miesiącach pracy nad AnimiliStartup School okiem uczestnika. O 3 miesiącach pracy nad Animili
Startup School okiem uczestnika. O 3 miesiącach pracy nad AnimiliSpodek 2.0
 
AdTaily - twórz, dziel się, zarabiaj
AdTaily - twórz, dziel się, zarabiajAdTaily - twórz, dziel się, zarabiaj
AdTaily - twórz, dziel się, zarabiajSpodek 2.0
 
[spodek 2.0] Tworzenie prototypów serwisów internetowych
[spodek 2.0] Tworzenie prototypów serwisów internetowych[spodek 2.0] Tworzenie prototypów serwisów internetowych
[spodek 2.0] Tworzenie prototypów serwisów internetowychSpodek 2.0
 
[spodek 2.0] Erlang
[spodek 2.0] Erlang[spodek 2.0] Erlang
[spodek 2.0] ErlangSpodek 2.0
 
[spodek 2.0] ligspace.pl
[spodek 2.0] ligspace.pl[spodek 2.0] ligspace.pl
[spodek 2.0] ligspace.plSpodek 2.0
 
[spodek 2.0] Prototypowanie
[spodek 2.0] Prototypowanie[spodek 2.0] Prototypowanie
[spodek 2.0] PrototypowanieSpodek 2.0
 
[spodek 2.0] Pierwsze ząbki
[spodek 2.0] Pierwsze ząbki[spodek 2.0] Pierwsze ząbki
[spodek 2.0] Pierwsze ząbkiSpodek 2.0
 
Jak Google pomaga nam dbać o jakość stron WWW?
Jak Google pomaga nam dbać o jakość stron WWW?Jak Google pomaga nam dbać o jakość stron WWW?
Jak Google pomaga nam dbać o jakość stron WWW?Spodek 2.0
 
Przeznaczenie technologii Flex i Adobe AIR
Przeznaczenie technologii Flex i Adobe AIRPrzeznaczenie technologii Flex i Adobe AIR
Przeznaczenie technologii Flex i Adobe AIRSpodek 2.0
 
Internet salonem dla fotografii mody
Internet salonem dla fotografii modyInternet salonem dla fotografii mody
Internet salonem dla fotografii modySpodek 2.0
 
Między spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanego
Między spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanegoMiędzy spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanego
Między spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanegoSpodek 2.0
 
Blogvertising.pl przed i zaraz po inwestycji
Blogvertising.pl przed i zaraz po inwestycjiBlogvertising.pl przed i zaraz po inwestycji
Blogvertising.pl przed i zaraz po inwestycjiSpodek 2.0
 

Mehr von Spodek 2.0 (20)

Rentowna strona ecommerce przy 20 użytkownikach dziennie
Rentowna strona ecommerce przy 20 użytkownikach dziennieRentowna strona ecommerce przy 20 użytkownikach dziennie
Rentowna strona ecommerce przy 20 użytkownikach dziennie
 
Pozyskiwanie inwestora na przykładzie ServeCloud.pl
Pozyskiwanie inwestora na przykładzie ServeCloud.plPozyskiwanie inwestora na przykładzie ServeCloud.pl
Pozyskiwanie inwestora na przykładzie ServeCloud.pl
 
Marketingowy geniusz Lady GaGi
Marketingowy geniusz Lady GaGiMarketingowy geniusz Lady GaGi
Marketingowy geniusz Lady GaGi
 
Empathy optymalizacja postgre_sql
Empathy optymalizacja postgre_sqlEmpathy optymalizacja postgre_sql
Empathy optymalizacja postgre_sql
 
Co internet namieszał w budowaniu marki, czyli jak tworzyć fanbojów
Co internet namieszał w budowaniu marki, czyli jak tworzyć fanbojówCo internet namieszał w budowaniu marki, czyli jak tworzyć fanbojów
Co internet namieszał w budowaniu marki, czyli jak tworzyć fanbojów
 
Usability - narzędzia niskobudżetowe, z których warto i nie warto korzystać
Usability - narzędzia niskobudżetowe, z których warto i nie warto korzystaćUsability - narzędzia niskobudżetowe, z których warto i nie warto korzystać
Usability - narzędzia niskobudżetowe, z których warto i nie warto korzystać
 
Obowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowych
Obowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowychObowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowych
Obowiązki przedsiębiorcy internetowego w zakresie ochrony danych osobowych
 
NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?
NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?
NGN są na Śląsku! ...ale gdzie są nowe modele biznesowe?
 
Startup School okiem uczestnika. O 3 miesiącach pracy nad Animili
Startup School okiem uczestnika. O 3 miesiącach pracy nad AnimiliStartup School okiem uczestnika. O 3 miesiącach pracy nad Animili
Startup School okiem uczestnika. O 3 miesiącach pracy nad Animili
 
AdTaily - twórz, dziel się, zarabiaj
AdTaily - twórz, dziel się, zarabiajAdTaily - twórz, dziel się, zarabiaj
AdTaily - twórz, dziel się, zarabiaj
 
[spodek 2.0] Tworzenie prototypów serwisów internetowych
[spodek 2.0] Tworzenie prototypów serwisów internetowych[spodek 2.0] Tworzenie prototypów serwisów internetowych
[spodek 2.0] Tworzenie prototypów serwisów internetowych
 
[spodek 2.0] Erlang
[spodek 2.0] Erlang[spodek 2.0] Erlang
[spodek 2.0] Erlang
 
[spodek 2.0] ligspace.pl
[spodek 2.0] ligspace.pl[spodek 2.0] ligspace.pl
[spodek 2.0] ligspace.pl
 
[spodek 2.0] Prototypowanie
[spodek 2.0] Prototypowanie[spodek 2.0] Prototypowanie
[spodek 2.0] Prototypowanie
 
[spodek 2.0] Pierwsze ząbki
[spodek 2.0] Pierwsze ząbki[spodek 2.0] Pierwsze ząbki
[spodek 2.0] Pierwsze ząbki
 
Jak Google pomaga nam dbać o jakość stron WWW?
Jak Google pomaga nam dbać o jakość stron WWW?Jak Google pomaga nam dbać o jakość stron WWW?
Jak Google pomaga nam dbać o jakość stron WWW?
 
Przeznaczenie technologii Flex i Adobe AIR
Przeznaczenie technologii Flex i Adobe AIRPrzeznaczenie technologii Flex i Adobe AIR
Przeznaczenie technologii Flex i Adobe AIR
 
Internet salonem dla fotografii mody
Internet salonem dla fotografii modyInternet salonem dla fotografii mody
Internet salonem dla fotografii mody
 
Między spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanego
Między spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanegoMiędzy spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanego
Między spamem, a ewangelizacją. Kontrowersje wokół marketingu szeptanego
 
Blogvertising.pl przed i zaraz po inwestycji
Blogvertising.pl przed i zaraz po inwestycjiBlogvertising.pl przed i zaraz po inwestycji
Blogvertising.pl przed i zaraz po inwestycji
 

Kürzlich hochgeladen

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 

Kürzlich hochgeladen (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 

Skalowalna architektura na przykładzie soccerway.com

  • 1. Scalable architecture By Adam Brodziak Global Sports Media b.v.
  • 2. Abstract  Adam Brodziak An overview of modern web-based application architecture - from hardware infrastructure, through PHP/SQL code, HTML/CSS markup distribution. All of this spiced up by cache, loadbalancing and CDN.
  • 3. Who is this guy?  Lead developer at Global Sports Media  GSM collects and process sports data  GSM owns soccerway.com portal  Linux user  Interested in frameworks, design patterns  Semantic Web enthousiast  Football (soccer) fan
  • 4. Topics  The Challenge  Infrastructure  Code  Cache  CDN
  • 5. Topics  The Challenge  Infrastructure  Code  Cache  CDN
  • 6. Raw numbers  7 millions visits / month  52 millions pageviews / month  1 billion request / month  6TB of traffic / month  300k users at peak time  Quite a few clients using the same hardware
  • 7. Not so much, but...  700 leagues  Livescores  Game events  Match statistics  Rankings  Editorials
  • 9. The Challenge  Loads of data to process  Scores  Events  Stats  In real-time (livescores)  Growing number of visitors  13K hits/sec at peak-time
  • 10. 10 servers to run it all
  • 11. Topics  The Challenge  Infrastructure  Code  Cache  CDN
  • 14. Loadbalancing caveats  Don't relay on the local filesystem  Temporary files, session, logs  Avoid assuming exclusive/single cache  APC, Zend Cache  Use distributed session storage  Memcache, database  Encalsulate above
  • 17. Replicaton caveats  Writes only on master  Reads from slaves  Data consistency  Replication lag  Don't do $master->query('UPDATE session SET logged = 1'); $slave->query('SELECT logged FROM session');
  • 19. Topics  The Challenge  Infrastructure  Code  Cache  CDN
  • 20. PHP is slow!  Yes, but it does not matter!  Database access is slower  Cache over network is slower  Disk access is slower  HTTP requests are slower  Webservice calls are slower  Discover bottlenecks before blaming PHP
  • 21. It's about architecture  Heavy tasks in background  CRON, Gearman  Pregenerate stuff  Move some code to SQL  Calculations in queries  Stored procedures  Triggers  C/C++ or Java for heavy computation  Use PHP to glue it together
  • 22. PHP Frameworks  Hundreds of others  Which one to choose?
  • 23. Framework? Think again!  Raw performance matters  Support for master-slave replication  Multiple layers of cache  Working with accelerators (HipHop!)  Beware of bottlenecks  i.e. core part of framework is slow  Designed to scale
  • 24. Topics  The Challenge  Infrastructure  Code  Cache  CDN
  • 25. Cache is everywhere  CPU: L1, L2  Disk buffer  Linux filesystem  MySQL  PHP (APC)  Smarty  HTTP Proxy  Browser cache
  • 27. Memory is cheap  Pre-generate stuff  Store results in memory  APC, memcached  App config in memory  APC with stat=off  Increase RAM for MySQL  Disk is the new tape
  • 28. Memcached for the rescue!  Dead simple  Key-value  Distributed storage pool  Automatic invalidation after X sec  No garbage collecting invoked  Store arrays, objects, simple values  Easy integration
  • 29. Topics  The Challenge  Infrastructure  Code  Cache  CDN
  • 30. Reverse-proxy  First line of cache  Returns content if resource is up-to-date  Works on HTTP level  Can be integrated into existing infrastructure  Can do load balancing  In-memory cache storage  Squid, Nginx, Varnish
  • 31. Content Delivery Network  Network of servers  Worldwide  Automatic loadbalancing  Fast access (low ping time)  Data redundancy gratis  Ideal for static resources  But not only  Must-have for worldwide websites
  • 32. CDN as reverse-proxy  HTTP request / response chain  Embraces REST architecture  Requests are distributed  Reduces latency  Lowers traffic volume  Increases availability  i.e. Akamai Edge Suite
  • 33. CDN at soccerway.com  All of the content is served via CDN  Images, CSS, JS  Generated HTML  JSON for Ajax  90% of traffic via CDN  Origin requests only from Europe  Site online even if servers are down  Can't live without ;)
  • 34. Thank you for listening Questions?
  • 35. Interested?  Contact me:  adam@globalsportsmedia.com  www.goldenline.pl/adam-brodziak  www.linkedin.com/in/adambrodziak  We're hiring!  Web developers  Football / sport fans