Php ey final

28
A Pure Digital News Service for Ireland 14 Adorable Pictures of Cats Coding How We Grew TheJournal.ie John Needham – Web Developer

Transcript of Php ey final

Page 1: Php ey final

A Pure Digital News Service for Ireland

14 Adorable Pictures of Cats Coding

How We Grew TheJournal.ie

John Needham – Web Developer

Page 2: Php ey final

Who Are We?•Irish and International Content•News, Sports, Entertainment and discussion•Launched Sept 2010•iOS and Android apps•Desktop and touch

websites

Page 3: Php ey final

Who Are We?

•25 Journalists•2 Web Developers•2 App Developers•1 Cat

Page 4: Php ey final

Site Launch

Basic Wordpress site:

• Quick to build• Large feature set• Large and experienced WP talent pool• Lots of online help• Good CMS

Launched our iOS app within first monthAndroid app Feburary 2011

Page 5: Php ey final

Site Growth

1 million page views a month after 3 months:

• WP does not scale easily• Lots of features = Complex code base• Debugging a nightmare (hooks..)• No native caching• ( °□°╯ )╯︵ ┻━┻

Page 6: Php ey final

Site Growth - Maintenance

Developing in WordPress:

• Tried to use the WP framework (plugins)• Slow and messy (hooks)

Gave Up:

• Edit the core code• Faster development• Upgrading issues

Page 7: Php ey final

Site Growth - Maintenance

$query->get_posts();1 Function – 875 lines

Page 8: Php ey final

Site Growth - Caching

Caching in WordPress is a nightmare:

• All plugin based• Used w3-cache - cached to file• Dynamic Elements – not maintainable• Want to increase amount of user specific content

Page 9: Php ey final

Site Growth – Reliability

Dara O'Briain – crashes the site with only 10k views

Page 10: Php ey final

Solutions?

Buy – options are too customised

More Cache (varnish?) – wont fix dynamic content problem

Build New System – Resources and time?

Page 11: Php ey final

Our Solution

Goal – Build a simple API to power site and apps

• Use WordPress database, keep the CMS• Cherry-pick from WordPress for formatting and styling

• Lightweight and simple PHP front end• All in EC2

Page 12: Php ey final

Site Structure

Page 13: Php ey final

Challenges - Caching

110,000 posts 100,000 tag rivers 1,063,000 comments

Solution:• Cache all objects forever• Cache all rivers by IDs• Immediate cache invalidation

Page 14: Php ey final

Challenges - Content

Making Content Work Everywhere

• Platforms: browser, iOS and Android• Rich media support? (flash, silverlight, gifs)

Journalists. Awkward.

Page 15: Php ey final

Challenges - Content

Solution:

• Make our server do as much heavy lifting as possible

• Keep app html parsing to zero• Handle unknown embeds as a link• A lot easier to update a server than an app

Page 16: Php ey final

Challenges - Content

- Faster render time for apps

- Unknown content still accessible

Page 17: Php ey final

Mistakes along the way

Overdependent on external plugins• Liveblogs, JSON API, Social

Could have made better use of (small) frameworks• Avoid learning lessons the hard way.• Slim Framework

Doing Friday Deploys

Page 18: Php ey final

Mistakes along the way

EC2 does quirky things:

• Random IP changes causing an accidental DDoS

• Unpredictable Auto-Scaling – killing a healthy Varnish instance

Page 19: Php ey final

Mistakes along the way

Keeping Clients in Sync

• Could stop comment on apps, not on desktop...

Page 20: Php ey final

Some Lessons Learned Lots of good start-ups to use:

• Pusher – realtime websocket api, used on liveblogs and scores

• HostedGraphite – hassle free stats, essential for our API

Page 21: Php ey final

Some Lessons Learned

Profile EVERYTHING

• Xhprof• 3x load time improvement

Page 22: Php ey final

Some Lessons Learned

Know when Good Enough is OK:

• Too tempting to try and perfect everything• Ship it, Iterate

Hat tip: @dermdaly

Page 23: Php ey final

Results

Desktop Growth in 2012:

Page 24: Php ey final

Results

3x mobile growth in 2012:

Page 25: Php ey final

Results

Traffic?• Handling 50 million page views a month

Spikes?• Reddit test 2 weeks ago• 477,735 page views• No crash :)

Page 26: Php ey final

Results

Rolling out new features on new site

• Easier to release new features

• Live scores rolled out over last few weeks

Page 27: Php ey final

Going Forward

Continue our growth – 3x in 3 years Build our commenter communityNumber 1 news service in Ireland by next year

Page 28: Php ey final

We're Hiring!

www.thejournal.ie/jobs/

Can find me @JohnANeedham

Thanks to:Miguel MolinaBrian Fallon (@brianfallon)Paul Conroy (@conroyp)Steven McMemeBride (@steemcb)