case study: emusic€¦ · emusic • ~400,000 subscribers who pay monthly for downloads • ~6...

40
CASE STUDY: EMUSIC WordPress in the Enterprise

Upload: others

Post on 09-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

CASE STUDY: EMUSICWordPress in the Enterprise

Page 2: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

EMUSIC

• ~400,000 subscribers who pay monthly for downloads

• ~6 million visits a month

• Billions of HTTP requests / Millions of page views

eMusic  is  a  digital  music  service  for  independent-­‐minded  music  lovers.  eMusic  Members  sign  up  for  a  monthly  subscrip9on  that  allows  them  to  discover,  download  and  own  music.  eMusic’s  editors  and  writers  put  music  into  context  through  mix  of  new  and  old  music  discovery  tools.  eMusic  is  headquartered  in  New  York  with  an  office  in  London.  

Page 3: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

EMUSIC IS BUILT ON:

• Java

• Struts 1

• Hibernate

• JBoss

•Oracle

• Spring

•Day CRX

• Catalog Service

• Ratings Service

• Image Service

Page 4: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WE’RE MOVING!(Gradually!) to WordPress for all of our CMS needs

Page 5: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WEB SERVICES + WORDPRESSA majority of the hardcore business logic will live in services, but

the content, UI, and community will live in WordPress

Page 6: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

GOODBYE, DAY CRX

• the definition of Legacy

• we couldn’t upgrade

• no longer supported

• no UI

• coding nightmare

• we don’t miss it!

Page 7: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

SORRY, DRUPAL :(

•None of us knew it

• The things we did know, weren’t exciting

•Other developers preferred WordPress

Page 8: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WORDPRESS WINS!But it wasn’t easy...

Page 9: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WHAT WORDPRESS OFFERS• 11 Database Tables

• Custom Post Types

• Taxonomies

•Media Management

• User Management

• Plugin Management

• XML-RPC API

Page 10: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

DOES WORDPRESS OFFER?

• Scaling

• Complex Data Types

• Complex User Roles

• Complex Marketing Tools

• You aren’t putting your WHOLE website in there, are you?

•Who uses WordPress in the “real world”?

Page 11: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

YES!It does all of these things!

Page 12: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

LEARN THE VOCABULARY!

•What are Custom Post Types?

• Theming - what flexibility is available to me?

• How can we connect our data using custom Taxonomies?

• Research Plugins

• Read the Codex!

Page 13: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

MOVING CONTENT TO WORDPRESS

Do yourself a favor, and do some PLANNING

Page 14: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

PLANNING•Make an inventory of your content

•Make a site map

• Agree on how to export the content - WordPress schema? XML files?

• Strategize a MODULAR import process

•Don’t import unless you can easily re-import / update (deltas)

• Allow for turbulence / changing requirements

Page 15: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

THERE WILL BE BLOOD (GOTCHAS)

• Even with the best planning, there will be many painful moments

• Hey, I forgot to tell you... every piece of content HAS to be regionalized

•We’re used to doing X, where do I do that in WordPress - oh wait.... did I not already tell you that?

• Something weird is happening, did something import wrong - oh, you need to re-import all of the content? Yikes! Ok...

Page 16: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

NEW FEATURES

• You will probably end up building things that do not exist already

• Yes, plugins are awesome, but they are not all A+ quality and ready to build your business on

• Some business requirements may not have been tackled by the WordPress community, you can be the first!

Page 17: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

EXTENDBuilding plugins to suit the needs of your business

Page 18: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

PLUGINS ARE AWESOME!There are hundreds that already exist that you can start using

immediately!

Page 19: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

PLUGINS WE USE• Batcache - Memcached full-page caching mechanism

• bbPress - Bolt-on message boards (shares users!)

• BuddyPress - Bolt-on social (shares users!)

• Gravity Forms - Customer Service loves it!

• Google Sitemap Generator

• Jetpack - not yet, but I’m sure we will

• Akismet

Page 20: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

PLUGINS AREN’T PERFECT

•MOST aren’t updated regularly

•MOST don’t take your Custom Post Types into account

•MOST (NONE?) have no (any) clue that you are regionalizing your entire site

• Plugin authors aren’t required to do security audits

•Most authors don’t take High Availability and Object caching into account

Page 21: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

I AM GUILTY OF THIS!Movies, Audio, Like Buttons, etc...

Page 22: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

PLUGINS I WROTE OUT OF NECESSITY

• eMusic Post Types

• eMusic Radio

• eMusic Comments

• eMusic BuddyPress

• Avatar

• Cloud

• eMusic Calendar

• eMusic XML-RPC

• Like Buttons

•Minify

• Slot Machine

• eMusic Shortcodes

Page 23: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

AVATARGives users an interface to upload an “avatar” / photo right in

the WordPress admin - leverages Cloud

Page 24: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

CLOUDJust the CDN code from W3 Total Cache

Page 25: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

MINIFYCombine all of your JavaScript and CSS - it just works (in the

way I want it to work)!

Page 26: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

SLOT MACHINESchedule content in specific “slots” on the site

Page 27: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

A HYBRID APPROACHWordPress powered pages / XML-RPC-supplied data

Page 28: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

REGIONALIZATION

• US, UK, EU, CA or ALL

• Affects 90% of our WordPress database queries

•We use Custom Taxonomies

•Not without a cost - caching has to be in place to swallow expensive queries

•Optimizations had to be done to lower query count

Page 29: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

BACK TO THOSE QUESTIONS RAISED / MYTHS ABOUT

WORDPRESSDoes it do X, Y, or Z?

Page 30: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

SCALING• Batcache / Memcached

plugins are your conduit to the Memcached backend for the WP Object Cache

• APC

• Paul Irish’s HTML5 Boilerplate suggestions with caveats

• YSlow! / Google Page Speed

Page 31: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WE USE A LOT OF AMAZON WEB SERVICES

• Elastic Load Balancing

• Elastic Compute Cloud (EC2)

• Simple Storage Service (S3)

• Relational Database Service (RDS)

•Downloads and Streams are served from Amazon

Page 32: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

COMPLEX DATA TYPES = METADATA API

• Posts, Users, Comments have built-in Metadata capabilities

• SIMPLE APIs for saving complex objects as meta

• BYOT (Build your own tables) for your custom objects / data needs, you can still use API functions and $wpdb abstraction layer

•Metadata = some ID linked to Key / Value pairs

Page 33: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WHO USES WORDPRESS IN THE “REAL WORLD”?

•New York Times

•During the tsunami, the NYTimes was at its height serving 10,000 simultaneous page views of certain articles

• CNN

• TechCrunch

• Kanye West, Katy Perry, Grizzly Bear, the list is endless

Page 34: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WHAT WE LEARNED(sometimes painfully!)

Page 35: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

UNDERSTAND THE COST OF EVERYTHING

• Plugins add code

• Plugins may add database queries

• Plugins may add CSS and JS unexpectedly

• Use Debug Bar plugin to keep yourself honest

• Learn what benchmarks matter to you and run tests often

Page 36: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

PREPARE FOR MULTIPLE ENVIRONMENTS

• Local Dev

• Community Dev

• Staging - multiple

• Production - scales to multiple servers

• “Tools” - we block access to /wp-admin/

• XML-RPC servers

Page 37: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

XML-RPC IS THE BRIDGE BETWEEN NEW AND OLD

• Built right into WordPress

• Easily extensible

• In load-balanced environments, it is a great way to serve fancy new content to your Legacy UI / back-end

•We send JSON in the responses - a pseudo API for complex objects

Page 38: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WRITE A BUNCH OF PHP / MYSQL ON TOP OF

WORDPRESSWordPress is, literally, a bunch of PHP and MySQL code. You can

always write something custom, but leverage what’s inside of WordPress first - do not reinvent the wheel, WordPress IS the

wheel!

Page 39: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

WE’RE HIRINGIf you live in New York City (or want to live in NYC) and are really good at all things WordPress - talk to me or Ben Kotch

Page 40: CASE STUDY: EMUSIC€¦ · EMUSIC • ~400,000 subscribers who pay monthly for downloads • ~6 million visits a month • Billions of HTTP requests / Millions of page views eMusic’is’adigital’music’service’for’independent4minded’music’lovers.’eMusic’Members’

THANK YOU!@wonderboymusic

http://www.facebook.com/scott.c.taylorhttp://www.scotty-t.com

http://www.emusic.com/author/scott/