the great consolidation - entertainment weekly migration case study - sandcamp 2015

56
SANDcamp, San Diego, CA - February 27, 2015 The Great Consolidation Entertainment Weekly migration case study

Upload: jon-peck

Post on 15-Jul-2015

209 views

Category:

Internet


6 download

TRANSCRIPT

Page 1: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

SANDcamp, San Diego, CA - February 27, 2015

The Great ConsolidationEntertainment Weekly migration case study

Page 2: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Who are we?

• Four Kitchens Web Chefs

• Jon Peck - drupal.org/u/fluxsauce

• Matt Grill - drupal.org/u/drpal

• Patrick Coffey - drupal.org/u/pcoffey

Page 3: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Project overviewWhat did we do & who did it?

Page 4: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Entertainment Weekly

• Magazine that covers film, TV, music, Broadway theater, books, and pop culture

• 40th largest in the US

• ew.com

• 13.7 million consumers / week

Page 5: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Migration scope

• WordPress

• 10 blogs

• 51,616 terms

• 101,581 posts

• 90,435 images

• Vignette V6

• 117,326 articles

• 201,986 images

• 97,611 terms

• 4,924 galleries

Page 6: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Development Teams

• Four Kitchens - 3 developers to 6

• Time Inc. - 1 developer to 4

• Zoom, HipChat for regular communication

• Video really helps

• As does GitHub selfies :-)

Page 7: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Timeline

• First commit: April 29th, 2014

• Launch: January 29th, 2015

• 17 sprints

Page 8: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Delegation of responsibilities

• Four Kitchens

• Project Management

• Data structures

• Migration

• Implement design, advertising

• Time Inc.

• Product Owner

• Design

• Workflow

• Infrastructure, build process

Page 9: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

ProcessStandards and documentation

Page 10: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Definition of Readiness and Completion• Stakeholders

• Context necessary for development

• Developers

• Code reviews, PO acceptance, demo, docs

• Evolving framework

Page 11: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Code and style standards

• Algorithmically enforced

• PHP_CodeSniffer (rules from coder)

• jshint - syntax

• jscs - code style

• EditorConfig settings

Page 12: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Peer code reviews

• Functional - does it…

• Fulfill the intent of the story?

• Use best practices?

• Avoid technical debt?

Page 13: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Development Environments

• Documented project-specific process

• Superset of existing instructions

• Greatly reduced on-boarding time

• Provided plentiful feedback to DCMS

• Beta tested new VMs

Page 14: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Branching standard

• Reduces clutter

• Improves communication, navigation

• Best practices

• sprint-xx (kept for one sprint)

• SEGEWCMSM-YY (deleted after merge)

• Tags added when deleting sprint branch

Page 15: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Front-endTheming, performance and advertising

Page 16: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

THEMING

Page 17: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

https://www.drupal.org/project/aurora

Aurora, mobile first theming

• Used Aurora as base theme

• HTML5, Sass & Compass

• Mobile theme is sub-theme of Aurora

• Desktop is a sub-theme of Mobile

Page 18: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Gulp task management

• Compiles Sass

• Runs JavaScript checkers

• jshint

• jscs

Page 19: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

JAVASCRIPT

Page 20: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

JavaScript global scoping

• Created global JS object for all EW functions

• Best practice

• Centralized point of entry

• Easy access

Page 21: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Atomic JavaScript functionality• Break related functions into individual files

• Only load what’s needed

• No monolithic structure

• Improves front-end performance

Page 22: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

PREPROCESSING

Page 23: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Balancing performance with business logic• Node template data built in pre-processing

• Does not use views, panels

• Clean & reusable

• Intuitive structure

• Helper and abstractions

Page 24: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

BEACONS

Page 25: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Global metadata object

• Useful for integrations requiring metadata

• Avoids repetition

• Facilitates data collection by crawlers

Page 26: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Beacon performance

• Delay loading of beacons (non-blocking)

• Use defer for injecting JS tags

Page 27: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

ADVERTISING

Page 28: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Collaborating with DCMS

• TGX improvements

• Single-request mode

• More native GPT functionality

• Ad Manager

• Patches, recommendations

Page 29: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Custom ad rendering to maximise performance• No logic in templates

• Data attributes contain values

• Avoids inline JS

• Improves rendering performance

• Ad renders in footer (after page load)

Page 30: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Editorial UI & Workflow

Page 31: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Packages and Channels

• Automatic dynamic content

• Editors define rules for selection

• Optional manual curation

Page 32: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Custom content types

• Used existing DCMS features to begin

• Rounds of PO, editor feedback

• Usability key to adoption

Page 33: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Collaboration with DCMS

• Provided feedback on tools

• Search interfaces

• Transient messages

• Crop tool

• Auto save

Page 34: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Dynamic Entity References

• Lots of aggregate views in EW

• Editorial control of views, but with overrides

• Custom module that “fills in” empty parts of a view based on context

• View lists 15, editor defines 5, DER populates remaining

Page 35: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Dynamic ER challenges

• Modular, extensible, reusable

• Accurate dynamically curated nodes

• High performance

• Editoral expectations for caching

• State Machine integration

Page 36: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Content migrationsWordPress, Vignette to Drupal

Page 37: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

WORDPRESS

Page 38: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Challenges

• 10 different blogs

• Different structures

• Multiple taxonomies

• Invalid markup

• Custom shortcodes, filters

• WordPress Migrate module not enough

Page 39: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Solutions

• Interviewed other teams, shared code

• Pre-processing

• Strip comments

• Combine into one monolithic file

• Separates authors, tags, images

Page 40: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Shortcodes and Filters

• Custom markup

• Created custom short code system

• Most will not be migrated

• Pre-processing solution

• Render as HTML

• Used WordPress, existing code

Page 41: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

WordPress Migrate

• Can’t use directly…

• Can extend!

• Helps normalize WXR structure

• Focus on custom logic

Page 42: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Mapping terms on import

• Separates monolithic taxonomy

• Specific vocabularies

• New content types (people, creative works)

• CSV Spreadsheet used for defining rules

• Curated by Editors, PO

Page 43: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

VIGNETTE

Page 44: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Exporting from Vignette

• Coordinated with TI team

• Defined XML structure

• Gave feedback on export UI

• Resolve edge cases

Page 45: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Importing

• XML content is sanitized and validated

• Transforms overloaded taxonomies to content

• People, Creative Works

• Articles, Packages, Galleries

Page 46: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

MIGRATION PERFORMANCE

Page 47: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Improving migration performance• Validate all XML before ingestion

• Eliminate all PHP errors, warnings

• Avoid redundant migrations

• Separate in pre-import

• Reduce overall number of migrations

• Implement cache_counts

Page 48: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Reducing migration overhead

• Disabled solr, pathauto, metatag, others during migration

• Project requirement was 2.5; you should use 2.7

• Ran migrations in parallel

• Ensure HW resources are sufficient

Page 49: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Migration redirects

• Minimize Drupal performing redirects

• Redirect farm (rules, 1:1 redirects)

• Exported if source, target known

• DNS changes

• Redirects from migrated servers

Page 50: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Performance and caching

Page 51: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Frontend performance

• CSS

• Sass and Compass optimized

• Targeted - only load what’s needed

• JavaScript

• Linted, strict standards

• In the footer (non-blocking)

• Global objects (less is more)

Page 52: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Frontend caching strategy

• Editorial 1 minute publish to live

• Ensure cacheable headers are set

• Shorter TTL on Akamai than Varnish

• Ex: 5 minutes on Akamai, 10 on Varnish

• Send purges on publishing

Page 53: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Backend performance

• Eliminate PHP errors

• Cache, EXPLAIN custom queries

• Minimize unnecessary overhead

• Module count

• Benchmarking

Page 54: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Performance testing

• Load test production with migrated data

• blitz.io

• New Relic for introspection

• Exercised different content types, exceeded TTLs

• Front-end testing

• WebPageTest.org

Page 55: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Questions?

Page 56: The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcamp 2015

Thank you!