SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Dan Beil | @add_action_dan
So You Think You Can
Scale
Dan Beil | @add_action_dan
Hi, Im Dan Beil
- Me
- (current) Dev Team Lead at Crowd Favorite
- (former) Software Developer at Alley Interactive
- (WordPress VIP Partner)
- Working with WordPress since ~ 2009
- B.S. in Applied Sociology
- Dogs
Dan Beil | @add_action_dan
Why this talk?
Scaling is about more than just site
performance and code
Dan Beil | @add_action_dan
What Does “Scale” Mean?
1. Risk - Cannot go down
2. Complexity - Constant feature additions,
interface
3. Traffic - Large (concurrent) user base
4. You Know it when you see it
Dan Beil | @add_action_dan
How to “Think at Scale”
Account the for unknown
so it doesn’t break
Dan Beil | @add_action_dan
How to “Think at Scale”
- Site Architecture
- Plugins
- Code Performance
- Code Portability
Dan Beil | @add_action_dan
How to “Think at Scale” - Site Arch.
Site Architecture
- Consider Content Types
- Determine relationships between
Content and what architecture will
best suit these relationships
- Meta Data vs CPTs vs Taxonomies
- Future query concerns
- Unknown future content (use the WP
Theme Unit Testing data)
https://codex.wordpress.org/Theme_
Unit_Test
Home
About Contact Team
CPTs
Page
Team
CPT
archive
Custom
Template
Dan Beil | @add_action_dan
How to “Think at Scale” - Plugins
● All 3rd Party Code introduces
Some type of risk
○ Maintenance
○ Updates
○ Support/Communication
○ Not feature complete for the
project (i.e. on 80%)
○ I.e. not just security
● Choose your 3rd Party Code Wisely
And 3rd party Code
Dan Beil | @add_action_dan
How to “Think at Scale” - Plugins
The Cost / Benefit Choice:
● Ask WHY you are using a
plugin and SHOULD you
learn to code THIS yourself.
My list of Plugins:
● https://vip.wordpress.com/plugins/
● Gravity Forms, SearchWP, Core
Plugins (WP API)
● Highly complex (eCommerce)
● Generally, things that are proven
And 3rd party Code
Dan Beil | @add_action_dan
How to “Think at Scale” - Performance
● Lots to read on this
● Meta and Term Queries
○ Tools to find ‘bad’ queries
■ Phpcs (VVV)
■ Query Monitor
(Plugin - John Blackbourn)
● https://10up.github.io/Engineering-Best-Practices/php/
Dan Beil | @add_action_dan
How to “Think at Scale” - Portability
Definition:
● Any Developer
● Any Project
● Any Time
Dan Beil | @add_action_dan
How to “Think at Scale” - Portability
● Code Organization
● Single Responsibility Principle
● Abstraction of code and re-usability
● Sending variables to template parts
https://core.trac.wordpress.org/ticket/21676
Dan Beil | @add_action_dan
How to “Think at Scale” - Portability
Code Organization
● Directory Structure
● Coding Standards
○ PHPCS
● Local environments
○ Build tools (Grunt / Gulp)
Dan Beil | @add_action_dan
How to “Think at Scale” - Portability
Single Responsibility Principle
https://en.wikipedia.org/wiki/Single_responsibility_principle
● Get logic code off of
template parts
○ Use Helper Functions
○ Custom new WP_Queries
● If you’ve coded it twice,
you’ve coded too much
Dan Beil | @add_action_dan
How to “Think at Scale” - Portability
Borrowing from the logic of the
Single Responsibility Principle
and applying its idea to
templates will sometimes
require us to send variables to
template parts
Dan Beil | @add_action_dan
How to “Think at Scale” - Portability
Each (sub) template part should
do one thing and one this only
Dan Beil | @add_action_dan
<project>_get_template_part( ‘template-parts/author’,
array(
$post_id,
$class,
$link )
);
How to “Think at Scale” - Portability
Example Cuatom get_template_part function
Dan Beil | @add_action_dan
How to “Think at Scale”
- Site Architecture
- How are you organizing content
- Plugins
- What dependencies are you willing to accept
- Code Performance
- Total Users, Concurrent Users, Hosting / Caching considerations
- Code Portability
- The importance of _thinking_ about code logic before actually writing
Dan Beil | @add_action_dan
More Resources
WP_Query (10up) - https://10up.github.io/Engineering-Best-Practices/php
Elastic Search (Aaron Holbrook) - http://wordpress.tv/?s=aaron+holbrook
My Preferred Envrionment - https://github.com/Varying-Vagrant-Vagrants/
WordPress Core coding standards -
https://make.wordpress.org/core/handbook/best-practices/coding-standar
ds/php/
Make Ticket on passing vars to templates -
https://make.wordpress.org/core/handbook/best-practices/coding-standar
ds/php/
Dan Beil | @add_action_dan
Thanks, Questions?
Slides at:

Más contenido relacionado

La actualidad más candente

Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?Weng Wei
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQLTomasz Bak
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneTroy Miles
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Derek Jacoby
 
Why & How to Create a WordPress Plugin
Why & How to Create a WordPress PluginWhy & How to Create a WordPress Plugin
Why & How to Create a WordPress PluginJoe Querin
 
Aspect-Oriented Programming for PHP
Aspect-Oriented Programming for PHPAspect-Oriented Programming for PHP
Aspect-Oriented Programming for PHPWilliam Candillon
 
Using JavaScript Libraries like D3.js with WordPress
Using JavaScript Libraries like D3.js with WordPressUsing JavaScript Libraries like D3.js with WordPress
Using JavaScript Libraries like D3.js with WordPressJohn Cook
 
How to GraphQL: React Apollo
How to GraphQL: React ApolloHow to GraphQL: React Apollo
How to GraphQL: React ApolloTomasz Bak
 
Into to GraphQL
Into to GraphQLInto to GraphQL
Into to GraphQLshobot
 
Putting the Develop in Development
Putting the Develop in Development Putting the Develop in Development
Putting the Develop in Development Jason Yingling
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6Derek Jacoby
 
Introduction to webpack and babel
Introduction to webpack and babelIntroduction to webpack and babel
Introduction to webpack and babelAmanRaj378
 
Beyond the post wcmiami 2015
Beyond the post wcmiami 2015Beyond the post wcmiami 2015
Beyond the post wcmiami 2015Dan Beil
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of RESTYos Riady
 

La actualidad más candente (20)

Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
Angular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUpAngular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUp
 
Frontend as a first class citizen
Frontend as a first class citizenFrontend as a first class citizen
Frontend as a first class citizen
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQL
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and Backbone
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
 
Why & How to Create a WordPress Plugin
Why & How to Create a WordPress PluginWhy & How to Create a WordPress Plugin
Why & How to Create a WordPress Plugin
 
GraphQL
GraphQLGraphQL
GraphQL
 
Aspect-Oriented Programming for PHP
Aspect-Oriented Programming for PHPAspect-Oriented Programming for PHP
Aspect-Oriented Programming for PHP
 
Using JavaScript Libraries like D3.js with WordPress
Using JavaScript Libraries like D3.js with WordPressUsing JavaScript Libraries like D3.js with WordPress
Using JavaScript Libraries like D3.js with WordPress
 
Graph QL + Swift
Graph QL + SwiftGraph QL + Swift
Graph QL + Swift
 
How to GraphQL: React Apollo
How to GraphQL: React ApolloHow to GraphQL: React Apollo
How to GraphQL: React Apollo
 
Into to GraphQL
Into to GraphQLInto to GraphQL
Into to GraphQL
 
Putting the Develop in Development
Putting the Develop in Development Putting the Develop in Development
Putting the Develop in Development
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
 
Dynamic content with Angular
Dynamic content with AngularDynamic content with Angular
Dynamic content with Angular
 
Introduction to webpack and babel
Introduction to webpack and babelIntroduction to webpack and babel
Introduction to webpack and babel
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
Beyond the post wcmiami 2015
Beyond the post wcmiami 2015Beyond the post wcmiami 2015
Beyond the post wcmiami 2015
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of REST
 

Similar a So you think you can scale

Spark: Authoring Experience++ in Drupal 7, 8, and Beyond
Spark: Authoring Experience++ in Drupal 7, 8, and BeyondSpark: Authoring Experience++ in Drupal 7, 8, and Beyond
Spark: Authoring Experience++ in Drupal 7, 8, and BeyondAngela Byron
 
Managing a Project the Drupal Way - Drupal Open Days Ireland
Managing a Project the Drupal Way - Drupal Open Days IrelandManaging a Project the Drupal Way - Drupal Open Days Ireland
Managing a Project the Drupal Way - Drupal Open Days IrelandEmma Jane Hogbin Westby
 
Production process presentation - drupalcamp Toronto 2010
Production process presentation - drupalcamp Toronto 2010Production process presentation - drupalcamp Toronto 2010
Production process presentation - drupalcamp Toronto 2010Aidan Foster
 
Learning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails LaunchLearning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails LaunchThiam Hock Ng
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyMarcos Labad
 
Big Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsBig Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsAndrew Brust
 
Pre-Aggregated Analytics And Social Feeds Using MongoDB
Pre-Aggregated Analytics And Social Feeds Using MongoDBPre-Aggregated Analytics And Social Feeds Using MongoDB
Pre-Aggregated Analytics And Social Feeds Using MongoDBRackspace
 
Going Mobile First With Drupal
Going Mobile First With DrupalGoing Mobile First With Drupal
Going Mobile First With DrupalJesper Wøldiche
 
Recruiting for Drupal #Hiring
Recruiting for Drupal #HiringRecruiting for Drupal #Hiring
Recruiting for Drupal #HiringGaurav Gaur
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?Wong Hoi Sing Edison
 
LvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemLvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemVlad Fedosov
 
Creating a Documentation Portal
Creating a Documentation PortalCreating a Documentation Portal
Creating a Documentation PortalSteve Anderson
 
Prototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesPrototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesMarta Soncodi
 
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8Wong Hoi Sing Edison
 
Agular in a microservices world
Agular in a microservices worldAgular in a microservices world
Agular in a microservices worldBrecht Billiet
 
Drupal 8 Initiatives
Drupal 8 InitiativesDrupal 8 Initiatives
Drupal 8 InitiativesAngela Byron
 
Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014Alex De Winne
 

Similar a So you think you can scale (20)

Spark: Authoring Experience++ in Drupal 7, 8, and Beyond
Spark: Authoring Experience++ in Drupal 7, 8, and BeyondSpark: Authoring Experience++ in Drupal 7, 8, and Beyond
Spark: Authoring Experience++ in Drupal 7, 8, and Beyond
 
Automation in Drupal
Automation in DrupalAutomation in Drupal
Automation in Drupal
 
Managing a Project the Drupal Way - Drupal Open Days Ireland
Managing a Project the Drupal Way - Drupal Open Days IrelandManaging a Project the Drupal Way - Drupal Open Days Ireland
Managing a Project the Drupal Way - Drupal Open Days Ireland
 
Production process presentation - drupalcamp Toronto 2010
Production process presentation - drupalcamp Toronto 2010Production process presentation - drupalcamp Toronto 2010
Production process presentation - drupalcamp Toronto 2010
 
Learning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails LaunchLearning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails Launch
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
Big Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsBig Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI Pros
 
Pre-Aggregated Analytics And Social Feeds Using MongoDB
Pre-Aggregated Analytics And Social Feeds Using MongoDBPre-Aggregated Analytics And Social Feeds Using MongoDB
Pre-Aggregated Analytics And Social Feeds Using MongoDB
 
Going Mobile First With Drupal
Going Mobile First With DrupalGoing Mobile First With Drupal
Going Mobile First With Drupal
 
Recruiting for Drupal #Hiring
Recruiting for Drupal #HiringRecruiting for Drupal #Hiring
Recruiting for Drupal #Hiring
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
 
LvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemLvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design System
 
Migrate all the things!
Migrate all the things!Migrate all the things!
Migrate all the things!
 
Creating a Documentation Portal
Creating a Documentation PortalCreating a Documentation Portal
Creating a Documentation Portal
 
Prototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesPrototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, Prototypes
 
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
 
Agular in a microservices world
Agular in a microservices worldAgular in a microservices world
Agular in a microservices world
 
Drupal 8 Initiatives
Drupal 8 InitiativesDrupal 8 Initiatives
Drupal 8 Initiatives
 
Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014
 

So you think you can scale

  • 1. Dan Beil | @add_action_dan So You Think You Can Scale
  • 2. Dan Beil | @add_action_dan Hi, Im Dan Beil - Me - (current) Dev Team Lead at Crowd Favorite - (former) Software Developer at Alley Interactive - (WordPress VIP Partner) - Working with WordPress since ~ 2009 - B.S. in Applied Sociology - Dogs
  • 3. Dan Beil | @add_action_dan Why this talk? Scaling is about more than just site performance and code
  • 4. Dan Beil | @add_action_dan What Does “Scale” Mean? 1. Risk - Cannot go down 2. Complexity - Constant feature additions, interface 3. Traffic - Large (concurrent) user base 4. You Know it when you see it
  • 5. Dan Beil | @add_action_dan How to “Think at Scale” Account the for unknown so it doesn’t break
  • 6. Dan Beil | @add_action_dan How to “Think at Scale” - Site Architecture - Plugins - Code Performance - Code Portability
  • 7. Dan Beil | @add_action_dan How to “Think at Scale” - Site Arch. Site Architecture - Consider Content Types - Determine relationships between Content and what architecture will best suit these relationships - Meta Data vs CPTs vs Taxonomies - Future query concerns - Unknown future content (use the WP Theme Unit Testing data) https://codex.wordpress.org/Theme_ Unit_Test Home About Contact Team CPTs Page Team CPT archive Custom Template
  • 8. Dan Beil | @add_action_dan How to “Think at Scale” - Plugins ● All 3rd Party Code introduces Some type of risk ○ Maintenance ○ Updates ○ Support/Communication ○ Not feature complete for the project (i.e. on 80%) ○ I.e. not just security ● Choose your 3rd Party Code Wisely And 3rd party Code
  • 9. Dan Beil | @add_action_dan How to “Think at Scale” - Plugins The Cost / Benefit Choice: ● Ask WHY you are using a plugin and SHOULD you learn to code THIS yourself. My list of Plugins: ● https://vip.wordpress.com/plugins/ ● Gravity Forms, SearchWP, Core Plugins (WP API) ● Highly complex (eCommerce) ● Generally, things that are proven And 3rd party Code
  • 10. Dan Beil | @add_action_dan How to “Think at Scale” - Performance ● Lots to read on this ● Meta and Term Queries ○ Tools to find ‘bad’ queries ■ Phpcs (VVV) ■ Query Monitor (Plugin - John Blackbourn) ● https://10up.github.io/Engineering-Best-Practices/php/
  • 11. Dan Beil | @add_action_dan How to “Think at Scale” - Portability Definition: ● Any Developer ● Any Project ● Any Time
  • 12. Dan Beil | @add_action_dan How to “Think at Scale” - Portability ● Code Organization ● Single Responsibility Principle ● Abstraction of code and re-usability ● Sending variables to template parts https://core.trac.wordpress.org/ticket/21676
  • 13. Dan Beil | @add_action_dan How to “Think at Scale” - Portability Code Organization ● Directory Structure ● Coding Standards ○ PHPCS ● Local environments ○ Build tools (Grunt / Gulp)
  • 14. Dan Beil | @add_action_dan How to “Think at Scale” - Portability Single Responsibility Principle https://en.wikipedia.org/wiki/Single_responsibility_principle ● Get logic code off of template parts ○ Use Helper Functions ○ Custom new WP_Queries ● If you’ve coded it twice, you’ve coded too much
  • 15. Dan Beil | @add_action_dan How to “Think at Scale” - Portability Borrowing from the logic of the Single Responsibility Principle and applying its idea to templates will sometimes require us to send variables to template parts
  • 16. Dan Beil | @add_action_dan How to “Think at Scale” - Portability Each (sub) template part should do one thing and one this only
  • 17. Dan Beil | @add_action_dan <project>_get_template_part( ‘template-parts/author’, array( $post_id, $class, $link ) ); How to “Think at Scale” - Portability Example Cuatom get_template_part function
  • 18. Dan Beil | @add_action_dan How to “Think at Scale” - Site Architecture - How are you organizing content - Plugins - What dependencies are you willing to accept - Code Performance - Total Users, Concurrent Users, Hosting / Caching considerations - Code Portability - The importance of _thinking_ about code logic before actually writing
  • 19. Dan Beil | @add_action_dan More Resources WP_Query (10up) - https://10up.github.io/Engineering-Best-Practices/php Elastic Search (Aaron Holbrook) - http://wordpress.tv/?s=aaron+holbrook My Preferred Envrionment - https://github.com/Varying-Vagrant-Vagrants/ WordPress Core coding standards - https://make.wordpress.org/core/handbook/best-practices/coding-standar ds/php/ Make Ticket on passing vars to templates - https://make.wordpress.org/core/handbook/best-practices/coding-standar ds/php/
  • 20. Dan Beil | @add_action_dan Thanks, Questions? Slides at: