+ All Categories
Home > Documents > what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails...

what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails...

Date post: 29-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
91
Transcript
Page 1: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the
Page 2: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

ThoughtWorksThoughtWorks

NEAL FORD software architect / meme wrangler

ThoughtWorks

[email protected] 3003 Summit Boulevard, Atlanta, GA 30319

www.nealford.com

www.thoughtworks.com

blog: memeagora.blogspot.com

twitter: neal4d

PAUL GROSS software developer / consultant

ThoughtWorks

[email protected] 200 E. Randolph St, 25th Floor, Chicago, IL 60601-6501

[email protected]

www.pgrs.net

www.thoughtworks.com

Rails in the Large:Building the Biggest (Enterprise)

Rails Application in the World

Page 3: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

what OVE.com does

Page 4: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the
Page 5: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the
Page 6: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

the pursuit

Go for the one that’ll beat the one that’ll beat the one you last did

Page 7: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

.NET Rails

Page 8: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the
Page 9: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

Business AnalystProject manager

DeveloperTech Lead

quick start: october 2006

Page 10: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

Added one pair every 2 weeks

Started with 2 pairs

8 or 9 pairs by July

inception: Jan 17, 2007

Page 11: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

6 quality assurance

11 pairs of developers 8 business analysts

client principle

project manager

now

iteration manager

Page 12: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

spikes are your friends!

technology isn’t as important as responsiveness to business needs

don’t try to convince too early

demonstration over arguments

lessons learned

Page 13: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

infrastructure

Rock is for Rookies: males have a

tendency to lead with Rock on their

opening throw

Page 14: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

pairing workstations

XServe (Selenium Grid)

physical infrastructure

BA

standalone QA

integrated QA

UAT (sneak peak)

Page 15: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

deployment stack

10 web boxes 2 image servers

background server memcache

4 database servers

Page 16: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

technical stats

Page 17: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

environment

Page 18: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the
Page 19: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

Mac OS X rocks

scale infrastructure opportunistically...

...but don’t wait too long

have fun

lessons learned

Page 20: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

testing

Scissors on First:play scissors as your

opening move against a more experienced player

Page 21: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

disconnected unit tests

UnitRecord and the evolution of unit tests that don’t hit the database

http://github.com/dan-manges/unit-record

Page 22: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

unit tests

Page 23: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

the rule:

unit tests don’t hit the database

mock everything

Page 24: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

functional tests

Page 25: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

no mocking allowed in functional tests

tests that hit the database are slooooow

Page 26: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

DeepTest

http://github.com/qxjit/deep-test

Page 27: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the
Page 28: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

DistributedDeepTest

Page 29: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

prefer factories over fixtures

Page 30: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

Selenium grid

Page 31: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

new instances added as needed

Page 32: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

deployment & testing

Page 33: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

write smart tests

fight the battle to keep tests fast

invent stuff if you have to

scale development infrastructure just like production infrastructure

lessons learned

Page 34: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

knowledge transfer

Paper is the least obvious of opening moves.

Page 35: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

project Mingle on the wall

Page 36: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

cc_board

http://github.com/qxjit/cc_board/

Page 37: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

jukebox.rb

http://subversion.hammersforge.com/jukebox.rb/trunk/

currently in alpha

Page 38: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

play a song when a build breaks

Page 39: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

pairing stations

adium

no email

Page 40: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

internal Jabber server chat rooms

devsBAsQAs

shared buddy list

Page 41: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

automatically set pair name

adium

Mingle card (upon commit)

Page 42: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

co-location rocks

software is more about communication than technology

use information radiators

have fun

pairing really rocks

lessons learned

Page 43: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

automate everything

When playing with someone who is not

experienced at the RPS, look out for double runs or, in other words, the

same throw twice.

Page 44: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

1-click deploy to any environment

using cc.rb as easy deployment tool

Page 45: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

verification (language keys)

run all unit tests

run all functional tests

commit

rake commit

http://github.com/pgr0ss/rake_commit_tasks

Page 46: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

canonical pairing station maintenance

cap pairing_stations

Page 47: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

radmindhttp://rsug.itd.umich.edu/software/radmind/

Page 48: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

strict rules for advanced language features

Tell your opponent what you are going to throw and then actually throw what you said.

Page 49: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

monkey patches all live in extensions folder

Page 50: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

modularize extensions

extend (or include)into real class

Page 51: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

ancestors

Page 52: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

where did you come from again?

Page 53: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

test the extensions

duh!

Page 54: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

include a version test to break upon upgrade

Page 55: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

use meta-names somewhere

ack is your friend

Page 56: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

background processing

Try playing the throw that would have lost to your opponents last throw

Page 57: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

run at a certain time

CRON-like behavior

progress bars

image downloading

Asynchronous behavior

counts

updating cached values

continually run

3 kinds

Page 58: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

evolution of async messaging

Page 59: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

do work inline

gets slower over time

traffic goes up

Page 60: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

use backgroundrb for simple message queue

backed by database

Page 61: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

switch to a real messaging queue

(Starling)

Page 62: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

YAGNI

emergent design around async messaging

Page 63: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

don’t use databases as message queues (for too long anyway)

avoid anticipatory design

gradually add complexity

DBA’s can sometimes get grumpy

lessons learned

Page 64: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

external dependencies

When playing against someone who asks you to remind them about the rules, take the opportunity to subtly "suggest a throw" as you explain to

them by physically showing them the throw you want them to play.

Page 65: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

make well defined boundaries

Page 66: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

mock and stub boundaries

Page 67: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

externals builds to test service changes

we often catch bugs & downtime in other services

Page 68: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

tests to validate WSDLs haven’t changed

Page 69: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

tests to call services

check that responses haven’t changed

Page 70: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

tests to check against content & html editors

non-printable characters

duplicate ids

Page 71: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

performance & optimization

When all else fails, go with paper: Statistically, in competition play, it has been observed that scissors is thrown the least often.

Page 72: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

not that many page views...

...really complex pages!

Page 73: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

custom hand-tuned SQL

Page 74: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

Memcache sessions & many database lookups

Page 75: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

MySQL replication

Page 76: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

use separate boxes for ETL schemas

write priority

Page 77: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

challenges

For tournament play, learn the Great Eight Gambits.

Page 78: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

scaling is hard

no matter the technology

Page 79: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

rails can scale!

Page 80: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

daily web trends

Page 81: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

monthly web trends

Page 82: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

upgrading is hard

1 pair => 6 weeks to upgrade from 1.2.3 to 2.2

Page 83: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

back port fixes & improvements

rails

other plugins

Page 84: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

we did not replicate a freakin’ type system!

# of is_a?, kind_of? instance_of? / Total LoC

32/32379 => code (0.09%)60/103421 => tests (0.06%)

Page 85: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

why all the rochambeau stuff?

Page 86: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

view builds are slow =>

separate cc.rb build =>

1 pair assigned as view masters

view builds are fragile =>

Page 87: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

worst ...job ...ever

Page 88: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

today’s view master assigned by yesterday’s...

...or play RPS

Page 89: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

http://www.worldrps.com/

Page 90: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

would we do it again?

hell yeah!

Page 91: what OVE.com doesassets.en.oreilly.com/1/event/24/Rails in the Large_How We're... · Rails Application in the World. what OVE.com does. the pursuit Go for the one that’ll beat the

ThoughtWorks

?’sThis work is licensed under the Creative Commons

Attribution-Share Alike 3.0 License.

http://creativecommons.org/licenses/by-sa/3.0/us/

NEAL FORD software architect / meme wrangler

ThoughtWorks

[email protected] 3003 Summit Boulevard, Atlanta, GA 30319

www.nealford.com

www.thoughtworks.com

blog: memeagora.blogspot.com

twitter: neal4d

PAUL GROSS software developer / consultant

ThoughtWorks

[email protected] 200 E. Randolph St, 25th Floor, Chicago, IL 60601-6501

[email protected]

www.pgrs.net

www.thoughtworks.com


Recommended