snakes on the web

122
Snakes on the Web: Jacob Kaplan-Moss http://jacobian.org/TO The history and future of Python on the web http://www.flickr.com/photos/kejhu/3751877257

Post on 18-Oct-2014

9.054 views

Category:

Technology


2 download

DESCRIPTION

The history and future of Python web development. A talk given at PyCon Argentina and PyCon Brazil, 2009.

TRANSCRIPT

Page 1: Snakes on the Web

Snakes on the Web:

Jacob Kaplan-Mosshttp://jacobian.org/TO

The history and future of Python on the web

http://www.flickr.com/photos/kejhu/3751877257

Page 2: Snakes on the Web

Web development sucks.

Page 3: Snakes on the Web

“”

How can I make this suck less?

Page 4: Snakes on the Web

1. What sucks now?

2. How will we fix it?

3. Can we fix it with Python?

Page 5: Snakes on the Web

In the beginning…

http://www.flickr.com/photos/tonythemisfit/2904911703

Page 6: Snakes on the Web

Hand-rolled HTML“The Stone Age”

Page 7: Snakes on the Web

The Stone Age

http://www.flickr.com/photos/schoschie/3421072476/

Page 8: Snakes on the Web

Suck.

Page 9: Snakes on the Web

“”

What if we didn’t have to write

HTML by hand?

Page 10: Snakes on the Web

CGI“The Bronze Age”

Page 11: Snakes on the Web

Suck.

Page 12: Snakes on the Web

“”

How can we make CGI better?

Page 13: Snakes on the Web

(Not really a big question.)

http://www.flickr.com/photos/randomurl/446209957/

Page 14: Snakes on the Web

PHP“The Iron Age”

Page 15: Snakes on the Web

Same idea, (slightly) better tech.

http://www.flickr.com/photos/jerhoyet/2377140741

Page 16: Snakes on the Web

Page-oriented

http://www.flickr.com/photos/just_jump/2972461681

Page 17: Snakes on the Web

“”

“What if we thought of these as applications,

not pages?”

Page 18: Snakes on the Web

Frameworks“The Industrial Revolution”

Page 19: Snakes on the Web
Page 20: Snakes on the Web

The modern web framework:

Page 21: Snakes on the Web

High-level

http://www.flickr.com/photos/nikonvscanon/2128705916

Page 22: Snakes on the Web

Application-oriented

http://www.flickr.com/photos/joelaz/2868356069

Page 23: Snakes on the Web

Large building blocks

http://www.flickr.com/photos/ppdigital/2329405081/

Page 24: Snakes on the Web

Rapid development

http://www.flickr.com/photos/jasephotos/2913135232/

Page 25: Snakes on the Web
Page 26: Snakes on the Web

Fun!

http://www.flickr.com/photos/nattu/1190083977

Page 27: Snakes on the Web

What’s next?

Page 28: Snakes on the Web

What sucks?

Page 29: Snakes on the Web

Interoperability sucks.

Page 30: Snakes on the Web

Frameworks: good.http://www.flickr.com/photos/amberandclint/3266859324/

Page 31: Snakes on the Web

Lock-in: bad!

http://www.flickr.com/photos/striatic/2191404675/

Page 32: Snakes on the Web

Rule 1:Don’t piss off your users.

Page 33: Snakes on the Web

Software becomes domain-specific.

Page 34: Snakes on the Web

Cede control gracefully.

http://www.flickr.com/photos/aidan_jones/3575000735

Page 35: Snakes on the Web

Framework inter-op:

http://www.flickr.com/photos/kpwerker/421386062/

Page 36: Snakes on the Web

Django’s not helping.

http://www.flickr.com/photos/mafleen/1694900141/

Page 37: Snakes on the Web

WSGI sucks.

http://www.flickr.com/photos/jacobian/408227408

Page 38: Snakes on the Web

Rack’s better.http://www.flickr.com/photos/lependu/3563742168/

Page 39: Snakes on the Web

Gateway ≠ API

Page 40: Snakes on the Web

Inter-language inter-op:

Page 41: Snakes on the Web

VMs, Proxies, SOA, ROA, …

Page 42: Snakes on the Web

Gateway ≠ API !

Page 43: Snakes on the Web

This’ll be hard to fix

http://www.flickr.com/photos/vgm8383/2381791019/

Page 44: Snakes on the Web

Disparate, mostly volunteer

communities.

Page 45: Snakes on the Web

Little overlap.

Page 46: Snakes on the Web

Rich applications suck.

Page 47: Snakes on the Web

HTML 5

Page 48: Snakes on the Web

The best thing to happen to web frameworks?

Page 49: Snakes on the Web

Current frameworks don’t fit.

http://www.flickr.com/photos/oskay/156280584/

Page 50: Snakes on the Web

State of the art:

Page 51: Snakes on the Web

1. Parallel MVC stacksLots of work to keep in sync.

Page 52: Snakes on the Web

2. Coupled frameworks(GWT, Cappuccino, SproutCore)

Page 53: Snakes on the Web

Page 54: Snakes on the Web

280slides

Create beautiful presentations, access them from anywhere, and share them with the world. With 280 Slides,

there's no software to download and nothing to pay for – and when you're done building your presentation you can

share it any way you like.

Page 55: Snakes on the Web

280 Slides:a site so complicated it needed a new language!

Page 56: Snakes on the Web

Python?

Page 57: Snakes on the Web

Deployment sucks.

Page 58: Snakes on the Web

Writing the app is easy…

Page 59: Snakes on the Web

The rest is hard!

Page 60: Snakes on the Web

• API Metering• Backups & Snapshots• Counters• Cloud/Cluster Management Tools

• Instrumentation/Monitoring • Failover• Node addition/removal and hashing• Auto-scaling for cloud resources

• CSRF/XSS Protection• Data Retention/Archival• Deployment Tools

• Multiple Devs, Staging, Prod• Data model upgrades• Rolling deployments• Multiple versions (selective beta)• Bucket Testing• Rollbacks• CDN Management

• Distributed File Storage

• Distributed Log storage, analysis• Graphing• HTTP Caching• Input/Output Filtering• Memory Caching• Non-relational Key Stores• Rate Limiting• Relational Storage• Queues• Rate Limiting• Real-time messaging (XMPP)• Search

• Ranging• Geo

• Sharding• Smart Caching

• Dirty-table management

http://randomfoo.net/2009/01/28/infrastructure-for-modern-web-sites

Page 61: Snakes on the Web

Lots of pieces

http://www.flickr.com/photos/restlessglobetrotter/448362507/

Page 62: Snakes on the Web

Huge opportunity

http://www.flickr.com/photos/nuclearsummer/2665337803/

Page 63: Snakes on the Web

Python’s been a very good glue language…

Page 64: Snakes on the Web

It could be again.

Page 65: Snakes on the Web

Scaling sucks.

Page 66: Snakes on the Web

Web audiences

Page 67: Snakes on the Web

Complexity

Page 68: Snakes on the Web

Traffic

Page 69: Snakes on the Web

Generic doesn’t scale.

Page 70: Snakes on the Web

Simple Complex

Generic

S

pecifi

c

Page 71: Snakes on the Web

Simple Complex

Generic

S

pecifi

c

My first blog

Page 72: Snakes on the Web

Simple Complex

Generic

S

pecifi

c

My first blog

Public launch

Page 73: Snakes on the Web

Simple Complex

Generic

S

pecifi

c

My first blog

Public launch

Average site

Page 74: Snakes on the Web

Simple Complex

Generic

S

pecifi

c

My first blog

Public launch

Average site

Twitter

Page 75: Snakes on the Web

Simple Complex

Generic

S

pecifi

c

My first blog

Public launch

Average site

Twitter

Fra

mew

ork

s

Page 76: Snakes on the Web
Page 77: Snakes on the Web

Most sites aren’t big.

Page 78: Snakes on the Web

What do we do?http://www.flickr.com/photos/b-tal/163450213/

Page 79: Snakes on the Web

Concurrency sucks.

Page 80: Snakes on the Web

All roads lead to multi-core.

http://www.flickr.com/photos/marc_buehler/3053243413

Page 81: Snakes on the Web

I’m scared.http://www.flickr.com/photos/amatuer_44060/2831112854/

Page 82: Snakes on the Web

Nehalem

Page 83: Snakes on the Web

UltraSPARC T2

Page 84: Snakes on the Web

128 hardware threads

128 threads

Page 85: Snakes on the Web
Page 86: Snakes on the Web

Ted thinks we’re screwed

http://www.flickr.com/photos/daninrgb/3406117892

Page 87: Snakes on the Web

StartServers128

Page 88: Snakes on the Web

I don’t think so.

Page 89: Snakes on the Web

Lots of exciting work in concurrency today:

Page 90: Snakes on the Web

ActorsSTM

Persistent data structuresDataflow

Tuple spaces

Page 91: Snakes on the Web

Ted Leung,A survey of concurrency constructs

http://tinyurl.com/mmbqe6

Page 92: Snakes on the Web

ScalaErlangClojureHaskell

Page 93: Snakes on the Web

Python?

Page 94: Snakes on the Web

Unladen Swallow?

Page 95: Snakes on the Web

No more GIL!

Page 96: Snakes on the Web

No more GIL?

Page 97: Snakes on the Web

Better threads.http://www.flickr.com/photos/splityarn/3469596708/

Page 98: Snakes on the Web

Threading sucks.

http://www.flickr.com/photos/sillydog/9844703/

Page 99: Snakes on the Web

I want actors!(Or STM, or whatever.)

Page 100: Snakes on the Web

Help!http://www.flickr.com/photos/zaia/3475695085

Page 101: Snakes on the Web

2020

Page 102: Snakes on the Web

I want to be using Python!

Page 103: Snakes on the Web

Let’s make Python kick ass in 2020.

Page 104: Snakes on the Web

“”

Good software takes ten years. Get used to it.

— Joel Spolskyhttp://tinyurl.com/ca4pr

Page 105: Snakes on the Web

So we need to start now.

Page 106: Snakes on the Web

1. Better inter-op.

Page 107: Snakes on the Web

WSGI 2

Page 108: Snakes on the Web

Django needs to do better.

Page 109: Snakes on the Web

We need leaders.http://www.flickr.com/photos/salimfadhley/26306549

Page 110: Snakes on the Web

A BDFL?

http://www.flickr.com/photos/psd/3649586425/

Page 111: Snakes on the Web

2. Get in front of HTML 5.

Page 112: Snakes on the Web

3. Rethink web development, again.

Page 113: Snakes on the Web

Pages

Page 114: Snakes on the Web

Applications

Page 115: Snakes on the Web

Sites

Page 116: Snakes on the Web

Full deployment stack, highly integrated,

centered around WSGI 2?

Page 117: Snakes on the Web

Yes, please!

Page 118: Snakes on the Web

4. Scale from day 1.

Page 119: Snakes on the Web

Be skeptical.http://www.flickr.com/photos/colorblindpicaso/2747637336

Page 120: Snakes on the Web

Plan to be replaced.

http://www.flickr.com/photos/taurusaficionado/2099239684

Page 121: Snakes on the Web

Holy crap please give me better concurrency!

Page 122: Snakes on the Web

Thank you!

Me: Jacob Kaplan-Moss

This talk: http://jacobian.org/TO

Email: [email protected]

Twitter: @jacobian