SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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ũ
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 

Último (20)

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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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?
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 

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