FIFA Ultimate Team at REST Dr. Harold Chaput, Technical Director, EA - - PowerPoint PPT Presentation

fifa ultimate team at rest
SMART_READER_LITE
LIVE PREVIEW

FIFA Ultimate Team at REST Dr. Harold Chaput, Technical Director, EA - - PowerPoint PPT Presentation

FIFA Ultimate Team at REST Dr. Harold Chaput, Technical Director, EA Canada Friday, October 8, 2010 1 Acknowledgements Server Dev Team W eb Dev Team Andrew Tjew Neale Genereux Chris Brown Andrey Soubbotin Mohammed Raihan Mark Obsniuk


slide-1
SLIDE 1

FIFA Ultimate Team at REST

  • Dr. Harold Chaput, Technical Director, EA Canada

1 Friday, October 8, 2010

slide-2
SLIDE 2

Acknowledgements

Server Dev Team Andrew Tjew Chris Brown Mohammed Raihan Mark Obsniuk W eb Dev Team Neale Genereux Andrey Soubbotin

2 Friday, October 8, 2010

slide-3
SLIDE 3

Overview

FIFA Ultimate Team What is REST? REST Benefits and Features Migrating FUT to REST Benefits of a RESTful FUT REST beyond FUT Advice for becoming RESTful

3 Friday, October 8, 2010

slide-4
SLIDE 4

FIFA Ultimate Team

4 Friday, October 8, 2010

slide-5
SLIDE 5

An Unexpected Game

Break some new ground, alternative to a licensed title Card trading game mode in Champions League 07 Expand the feature set, put it online, sell as add-on New product idea: prepared to break even

5 Friday, October 8, 2010

slide-6
SLIDE 6

Collect, Trade and Play

Purchase packs of players, contracts, power-ups T rade with other players Build your team

Team chemistry

Play your team against another player’s team Win coins

6 Friday, October 8, 2010

slide-7
SLIDE 7

An Unexpected Success

Turned a very good profit

More than the licensed product would have

Made more money w/ MTX than selling the mode Followed up w/ FUT2 and continued success

7 Friday, October 8, 2010

slide-8
SLIDE 8

Unexpected Problems

FUT1 servers were shaky at launch

Server bottlenecks, connected to FIFA servers

Game logic on client

Hard to update post- launch

UI info on the server (“glow”) Followed console model

  • f server per title

No year-over-year support

8 Friday, October 8, 2010

slide-9
SLIDE 9

A New Client

FUT W eb introduced in April 2010 FUT servers used proprietary format, not HTTP Took advantage of an

  • pportunity to start over

...with REST

9 Friday, October 8, 2010

slide-10
SLIDE 10

What is REST?

The dirty details

10 Friday, October 8, 2010

slide-11
SLIDE 11

What is REST?

REST stands for “REpresentation State T ransfer”

REST is style of software architecture REST is intended for online services

REST first defined by Roy Fielding

“ Architectural Styles and the Design of Network-based Software Architectures” (2000) Fielding is the principle author of HTTP 1.0 and 1.1 Created for “distributed hypermedia” systems Applications and benefits extend beyond WWW

11 Friday, October 8, 2010

slide-12
SLIDE 12

REST is a Style, like OOP

OOP is a style of software architecture

REST is a convention, not a syntax

OOP can be done in many languages

Many protocols can be RESTful

OOP has several variants and flavors

REST is also underdetermined

OOP is open to interpretation

There are many ways to be RESTful

OOP won’t solve all your problems, introduces new ones

REST is not a complete solution

Follow OOP , and gain benefits

...and so it is with REST

12 Friday, October 8, 2010

slide-13
SLIDE 13

REST Constraints

Client/Server (separation of concerns) Uniform Interface w/ Hyperlinks Stateless Cacheable Layered Code on Demand (optional)

13 Friday, October 8, 2010

slide-14
SLIDE 14

Client and Server

User Interface Rendering Current Page Device Security Database File Access Load Balancing Fraud Detection

Session State Application State Client Server

Separation of Concerns

? !

14 Friday, October 8, 2010

slide-15
SLIDE 15

Services and Resources

Client Server

Services

Message Folder Contact Mailing List Appointment Meeting Room

Resources

Application State Session State

?

Resource Representation

Mail Address Book Calendar

15 Friday, October 8, 2010

slide-16
SLIDE 16

Changing Application State

Client Server

Services

Message Folder Contact Mailing List Appointment Meeting Room

Resources

Application State Session State

?

Representational State Transfer

! Mail Address Book Calendar

16 Friday, October 8, 2010

slide-17
SLIDE 17

Statelessness

Stateful Stateless

move(direction, speed) set_position(x, y) u1=owner(i1) u2=owner(i2) assign(i1, u2) assign(i2, u1) u1=owner(i1) u2=owner(i2) assign(i1, u1, u2) assign(i2, u2, u1) find_user(“Bob”) send_msg(“Hello!”) send_msg(“Bob”, “Hello!”)

All required state information is in the request.

17 Friday, October 8, 2010

slide-18
SLIDE 18

Client

Cacheability

Representations are cacheable Counters extra traffic caused by statelessness Representations include expiration info Representations can contain references to resources

Client-side Cache Server-side Cache

Server

18 Friday, October 8, 2010

slide-19
SLIDE 19

Uniform Interface

Resources must be uniformly identified

The same ID results in the same resource

API consists of:

Resource representations Resource identifiers Requests and responses

19 Friday, October 8, 2010

slide-20
SLIDE 20

Env 2

Layered

Env 1

Service A Service B Service C Service D

Router Cache Authentication Filter

20 Friday, October 8, 2010

slide-21
SLIDE 21

REST Constraints

Client/Server (separation of concerns) Uniform Interface w/ Hyperlinks Stateless Cacheable Layered If it has all these properties, it is RESTful.

21 Friday, October 8, 2010

slide-22
SLIDE 22

Why REST?

What’s in it for me?

22 Friday, October 8, 2010

slide-23
SLIDE 23

REST Benefits

Simplicity

Issues stay where they belong Information is localized Developers know what to build, can work in parallel

Performance

Caching decreases response time, reduces DB hits Can distribute across multiple servers

Scalability

Services interact through references only Can easily introduce new hardware as required

Visibility

Clients know what resources are available Clients are informed of the new state

23 Friday, October 8, 2010

slide-24
SLIDE 24

REST Benefits

Portability

All clients use the uniform interface New clients can be added post hoc Prepare us for a multi-platform online world

Reliability

T ransactions continued on new hardware if overloaded or crashed Layered routers can direct traffic as needed

24 Friday, October 8, 2010

slide-25
SLIDE 25

REST Best Practices

HTTP

Conceptually compatible Use four verbs: GET, PUT, POST, DELETE

XML / JSON

Structured, easy to construct & parse, allows refs

Java / C# / Ruby / Python

Can be deployed on arbitrary hardware Built for reliability (not speed)

REST vs. SOAP

SOAP can be RESTful (and C can be OO) SOAP is more than you need for REST

25 Friday, October 8, 2010

slide-26
SLIDE 26

Twitter Facebook Picasa Y

  • uTube

Flickr Google OpenSocial JIRA Gowalla Amazon Spore ...hundreds more

RESTful Examples

26 Friday, October 8, 2010

slide-27
SLIDE 27

Migrating FUT to REST

Getting om here to there

27 Friday, October 8, 2010

slide-28
SLIDE 28

FUT Console Servers

Step 1: A RESTful API

FUT REST API W arehouse T rading Store Tournament s

28 Friday, October 8, 2010

slide-29
SLIDE 29

Step 2: RESTful Proxy

FUT Console Servers W arehouse FUT REST API FUT Application Server T rading Store Tournament s

29 Friday, October 8, 2010

slide-30
SLIDE 30

Step 3: Componentization

FUT Console Servers

W arehouse

FUT REST API FUT Application Server

T rading Store Tournaments

30 Friday, October 8, 2010

slide-31
SLIDE 31

Step 4: Application Servers

FUT Console Servers FUT REST API FUT Application Server

W arehouse T rading Store Tournaments

31 Friday, October 8, 2010

slide-32
SLIDE 32

Step 5: All Clients on REST

FUT REST API FUT Application Server

W arehouse T rading Store Tournaments

32 Friday, October 8, 2010

slide-33
SLIDE 33

How REST Benefits FUT

The Big Wins

33 Friday, October 8, 2010

slide-34
SLIDE 34

REST for Good Design

REST can guide good design decisions Example: transactions as resources Enforces stateless transactions Removed serious transaction problems and increased robustness

34 Friday, October 8, 2010

slide-35
SLIDE 35

Modular Services

FUT built from components Scaling components independently based on use Updating implementation one step at a time

35 Friday, October 8, 2010

slide-36
SLIDE 36

Services are Shared

FUT components used by other products FUT uses other shared components Components managed independently

36 Friday, October 8, 2010

slide-37
SLIDE 37

Enforces Organization

Each service has a well- defined function Dramatically fewer server bugs Problems are isolated and easy to find Clients better understand how to implement (web client took four months)

37 Friday, October 8, 2010

slide-38
SLIDE 38

Promotes Live Updating

Client gets state from server Easy to update functionality Even for data we didn’t expect to update: item types

38 Friday, October 8, 2010

slide-39
SLIDE 39

Support New Clients

No client assumptions in the server New clients can be supported quickly No need for server team support

39 Friday, October 8, 2010

slide-40
SLIDE 40

REST beyond FUT

What else can we do?

40 Friday, October 8, 2010

slide-41
SLIDE 41

Games as Products

41 Friday, October 8, 2010

slide-42
SLIDE 42

Games as Services

42 Friday, October 8, 2010

slide-43
SLIDE 43

Games as Services

43 Friday, October 8, 2010

slide-44
SLIDE 44

Advice for Getting Rest

Lessons Learned

44 Friday, October 8, 2010

slide-45
SLIDE 45

Think Resources

Define your services in terms of resources Determine how they will be identified, represented, manipulated Organize them hierarchically Opposite of OOP Not data hiding, data exposing

45 Friday, October 8, 2010

slide-46
SLIDE 46

API Before Code

Document your API before you write your server Get API vetted by client teams Development can start on client & server together Can test out API with working client & dummy data

46 Friday, October 8, 2010

slide-47
SLIDE 47

Plan to Hand Off

Build your service to be handed off to your ops team Don’t assume you have any control of the server Clients can go though unexpected layers May not talk to the same server instance twice

47 Friday, October 8, 2010

slide-48
SLIDE 48

Version through API

Expand existing APIs Build clients to ignore extra information When API meaning changes, make new resource Sunset old resources when clients stop using them

48 Friday, October 8, 2010

slide-49
SLIDE 49

Good Reference

Richardson & Ruby Understandable explanations Several good examples T ransaction resource

49 Friday, October 8, 2010

slide-50
SLIDE 50

The End

hchaput@ea.com

50 Friday, October 8, 2010