your language doesn't scale
DESCRIPTION
Another set of slides for Colorado Software Summit 2008. Again, I never ended up giving this talk because I had to ship product.TRANSCRIPT
![Page 1: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/1.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 1
Your Language Doesn't ScaleA Discussion of the Nature of Scaling
Ikai Lan
![Page 2: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/2.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 2
Hi! I’m Ikai Lan
![Page 3: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/3.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 3
This talk is about scaling
![Page 4: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/4.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 4
Particularly with regards to theweb
![Page 5: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/5.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 5
Attributes of a web app
Client pull based
Operations must finish “fast”
“Fresh” information
![Page 6: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/6.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 6
The chip on my shoulder
![Page 7: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/7.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 7
Ruby on Rails can’t scale!
Ruby is slow
Default SQL used is not optimal
Page rendering is slow
![Page 8: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/8.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 8
All of these are true
![Page 9: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/9.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 9
1. Ruby is slow
![Page 10: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/10.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 10
2. SQL used is not optimal
![Page 11: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/11.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 11
3. Rendering is slow
I don’t have a clever picture here.
Just take my word for it.
![Page 12: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/12.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 12
Why do these fall flat?
![Page 13: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/13.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 13
Scaling != efficiency
![Page 14: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/14.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 14
Efficiency is
Minimizing input foroutput
Bang for your buck
![Page 15: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/15.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 15
Scaling != performance
![Page 16: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/16.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 16
Performance is
Maximizing outputfor some input
Speed
![Page 17: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/17.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 17
Scalability is
Being able to growcapacity withdemand
How well a solutionto some problemwill work when thesize of the problemincreases
![Page 18: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/18.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 18
In an ideal world …
We achieve scalability
efficiently while maintaining
performance
![Page 19: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/19.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 19
Myth: Needing to throwhardware to solve acapacity problem meansyour application is notscalable
![Page 20: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/20.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 20
Truth: If this works, bythe definition, yourapplication IS scalable
![Page 21: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/21.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 21
… maybe not efficient
![Page 22: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/22.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 22
So the arguments …
Ruby is slow
Default SQL is notoptimal
Page rendering isslow
![Page 23: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/23.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 23
Internet
User
Concerning performance …
BrowserDatabase
Assets
![Page 24: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/24.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 24
Internet
User
How much time?
Rendering: LONG TIMELONG TIME
Assets
Tiny fraction
Network: ???
![Page 25: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/25.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 25
Scaling case study
![Page 26: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/26.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 26
First let’s define terms
![Page 27: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/27.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 27
Vertical scaling
Improvingperformance in oneof our componenttiers
Adding a tieroptimized for someportion of the load
![Page 28: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/28.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 28
Vertical scaling examples
Upgrading hardware
Edge caching
Adding a caching tier for the data store
![Page 29: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/29.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 29
Horizontal scaling
Increase capacity byincreasing instancesof components
Spreading loadacross instances
![Page 30: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/30.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 30
Horizontal scaling examples
Load balancing (hardware LB or DNSload balancing)
Data partitioning
![Page 31: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/31.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 31
Different strokes …
![Page 32: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/32.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 32
On to the case study!
![Page 33: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/33.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 33
These guys made a site
Matt Ikai
![Page 34: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/34.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 34
To share pictures!
![Page 35: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/35.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 35
Our first architecture
![Page 36: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/36.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 36
Awesome! We have users!
![Page 37: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/37.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 37
We have too many users!
![Page 38: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/38.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 38
Dude! Add more
hardware!
You don’t think I tried?
The hardware - it does
nothing!
The yelling begins
![Page 39: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/39.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 39
Our current architecture
![Page 40: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/40.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 40
Why isn’t this working?
![Page 41: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/41.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 41
Bottlenecks! Bottlenecks!
![Page 42: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/42.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 42
The first bottleneck is always thepersistent store
![Page 43: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/43.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 43
Solution: Replicate data
![Page 44: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/44.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 44
New problem: replication delay
How come everything I do
takes a few minutes to work?
![Page 45: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/45.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 45
Solution: caching
![Page 46: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/46.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 46
New problem: stale data
I can’t remove this tag!
Sometimes things aren’t up
to date!
![Page 47: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/47.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 47
So now we’ve spent all thatengineering effort and addedno new functionality
(would have been a lot harder if wewere also trying to add features tostay competitive)
![Page 48: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/48.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 48
Are we done? Maybe …
![Page 49: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/49.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 49
More growth: allpersistence operations areexpensive
![Page 50: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/50.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 50
Have to partition DB
![Page 51: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/51.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 51
Our application has to nowunderstand how to speakto a partitioned store
![Page 52: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/52.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 52
This is really hard!
![Page 53: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/53.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 53
And I haven’t even gottento transactional integrityor backups
![Page 54: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/54.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 54
We’re also introducingmany more points offailure = ops burden
![Page 55: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/55.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 55
Engineering problems
Cross functional development
Merging
Regression testing
![Page 56: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/56.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 56
Things now cost too much!
![Page 57: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/57.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 57
Do we even have a businessmodel?
![Page 58: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/58.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 58
No one is spared!
![Page 59: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/59.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 59
Questions?
![Page 60: Your language doesn't scale](https://reader038.vdocuments.mx/reader038/viewer/2022102922/5479cfafb4af9fc6398b473d/html5/thumbnails/60.jpg)
Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Linkedin
Ikai Lan — Your Language Doesn’t Scale Slide 60
Thanks for coming!
http://www.linkedin.com/in/ikailan