martin anderson - fast we promise

40
BETFAIR'S SITE REBUILD: FAST - WE PROMISE Martin Anderson LJC Open Conference 2011

Upload: bloodredsun

Post on 13-Dec-2014

855 views

Category:

News & Politics


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Martin Anderson - Fast We Promise

BETFAIR'S SITE REBUILD: FAST - WE PROMISE Martin Anderson LJC Open Conference 2011

Page 2: Martin Anderson - Fast We Promise

2

Page 3: Martin Anderson - Fast We Promise

THE EXCHANGE

3

Page 4: Martin Anderson - Fast We Promise

OUR PRODUCTS

4

Page 5: Martin Anderson - Fast We Promise

3.7M+ registered customers

140 locations

17 languages

£300M funds on deposit

30,000 bets placed one minute

88,000 http requests per second

INTERESTING STATS

5

Page 6: Martin Anderson - Fast We Promise

WHAT’S THE PROBLEM?

“during the world cup the site has run like treacle”

“the site is frequently slow and freezes too often”

“very slow and glitchy”

“I find Betfair slow”

We lost focus on our website

6

Page 7: Martin Anderson - Fast We Promise

http://bit.ly/bf-cc OUR CUSTOMER COMMITMENT

7

Page 8: Martin Anderson - Fast We Promise

PERFORMANCE – 95 PECENTILE

8

Page 9: Martin Anderson - Fast We Promise

OPTIONS?

•  Fix •  Rebuild

•  We chose to rebuild with a new architecture

•  Started earlier this year

9

Page 10: Martin Anderson - Fast We Promise

It Works

It’s Fast

It’s Useful

It’s Cool

HIERARCHY OF WEBSITE NEEDS

10

Page 11: Martin Anderson - Fast We Promise

FIVE FUNDAMENTALS OF A WORLD CLASS WEB SITE

•  Operational Monitoring •  Performance •  Customer Analytics •  SEO •  Experimentation Framework

11

Page 12: Martin Anderson - Fast We Promise

DOT COM ERA ARCHITECTURE

Single component responsible for data

access, business logic and presentation

12

Page 13: Martin Anderson - Fast We Promise

CURRENT ARCHITECTURE

Data Services

Lightweight web servers for cached

HTML and JS

Heavy use of client-side rendering with

JavaScript

13

Page 14: Martin Anderson - Fast We Promise

NEXT GENERATION ARCHITECTURE

Data Services

Server-side rendering using Java

No client-side rendering only updates

via JavaScript

14

Page 15: Martin Anderson - Fast We Promise

TECHNOLOGY STACK

•  Java, JavaScript (YUI), FreeMarker, Spring 3.0, Tomcat 7

•  TestNG, Mockito, Groovy, Selenium2, Jasmine, PhantomJS

15

Page 16: Martin Anderson - Fast We Promise

WHY CHOOSE JAVA?

•  Good knowledge already at Betfair •  Real concurrency – great for heavy server

workload •  Large Community •  Great Toolset •  Operations Teams understand Java – stats,

GC logs, deployment process

16

Page 17: Martin Anderson - Fast We Promise

JAVA IN THE WEB TIER

•  Java is obviously great at server tasks but does it work well in the web tier?

•  Can it be as flexible as Ruby or Python?

17

Page 18: Martin Anderson - Fast We Promise

MODULE CONFIGURATION FRAMEWORK

•  Deals with the impendence mismatch between the web and statically typed languages

•  Hugely flexible •  Easy to work with heterogeneous skillsets

18

Page 19: Martin Anderson - Fast We Promise

MODULE CONFIGURATION FRAMEWORK

•  All pages are an aggregation of modules in a layout

•  Modules are the smallest measure of functionality on a page

•  Modules can live within other modules •  Configuration controls the service calls and

the rendered modules

19

Page 20: Martin Anderson - Fast We Promise

MODULE CONFIGURATION FRAMEWORK

20

Page 21: Martin Anderson - Fast We Promise

CONCURRENCY MODEL

dispatch service calls

controller’s job done

rendering starts early

21

Page 22: Martin Anderson - Fast We Promise

PERFORMANCE OPTIMIZATIONS

•  Reduce HTTP requests • Minify and compress assets (WRO4J) •  Split requests across domains • Use cookie-free CDN hostnames •  Flush the buffer early • Defer loading of content •  Etc…

22

Page 23: Martin Anderson - Fast We Promise

CUSTOMER ANALYTICS

• Omniture Tagging •  Server side clickstream

•  Able to generate heatmaps of site usage

23

Page 24: Martin Anderson - Fast We Promise

SEARCH ENGINE OPTIMISATION

•  Single HTML response •  “Pretty” URLs •  Tasty bot fodder • No redirects • No duplications •  Crafted content

24

Page 25: Martin Anderson - Fast We Promise

EXPERIMENTATION FRAMEWORK

•  An extension of the MCF •  Allows A/B or Multivariate testing •  Allows business to make decisions based on empirical data

• Winning experiments can be rolled out without a redeployment

25

Page 26: Martin Anderson - Fast We Promise

CONTINUOUS DELIVERY

•  Its not about changing the product daily •  Its about confidence in the quality of your

product •  Its about eliminating waste from your

development cycle

26

Page 27: Martin Anderson - Fast We Promise

CHALLENGES

•  Automation is key •  Branch in code •  Feature Toggles •  Technology only takes you so far; it’s a

cultural shift •  “Developers aren’t done until the tests

pass”

27

Page 28: Martin Anderson - Fast We Promise

28

Page 29: Martin Anderson - Fast We Promise

OPERATIONAL MONITORING

•  Analytics •  Trending •  Fault-detection / alerting •  Capacity planning

29

Page 30: Martin Anderson - Fast We Promise

PERFORMANCE MEASUREMENT

30

Page 31: Martin Anderson - Fast We Promise

LOG MINING

Access logs: User agents, response times, payload sizes Performance logs: Timings of code paths and dependent service calls Correlation IDs to trace requests across tiers

31

Page 32: Martin Anderson - Fast We Promise

GRAPHS

32

Page 33: Martin Anderson - Fast We Promise

SERVER-SIDE WATERFALL GRAPH

33

Page 34: Martin Anderson - Fast We Promise

FLUSHING THE BUFFER

Networking device thwarting flush() code Magic setting: httpcompressonpush=1

34

Page 35: Martin Anderson - Fast We Promise

RESULT

35

Page 36: Martin Anderson - Fast We Promise

SO WHAT CHANGED?

36

Page 37: Martin Anderson - Fast We Promise

FEEDBACK

Customer: “Faster”

Customer: “Seems faster and more user friendly”

Customer: “page loaded quicker”

Ops Guy: “Our current down time is zero!”

37

Page 38: Martin Anderson - Fast We Promise

RESULTS

•  Sessions that bet: up 2 percentage points

•  Bounce rate: improved 40% •  Page views: 2x •  1% opt-out rate

38

Page 39: Martin Anderson - Fast We Promise

WHAT HAVE WE LEARNED?

•  Performance improvements are tangible • Measurably improves the bottom line •  Operational Monitoring and Customer

Analytics provides essential visibility •  There’s lots more to do but we now have the

platform to do this

39

Page 40: Martin Anderson - Fast We Promise

THANK YOU

Email: [email protected] Twitter: @mdjanderson Blog: http://bloodredsun.com/ Betfair Blog: http://views.betfair.com/

40