Visit itscales.org
Watch http://www.youtube.com/watch?v=HeXDvOZcdD4
The social web is alive! And with it all of its technical challenges. Never had the servers to answer that many requests, never to store so much data. While the technological leaders like Facebook and Google use highly customized super scale systems that run on provincial town sized server farms distributed all over the world current web frameworks barely offer a single strategy to scale. Where the leaders use highly efficient caching mechanisms, frameworks recalculate responses over and over again. Where the leaders automatically add new machines for processing, frameworks allow to manually add machines without a designated field of work.
Scales comes to the rescue! It’s a super scale web framework developed with the knowledge of this thesis that clearly splits up responsibilities and makes them individually scaleable. No response is calculated twice as 100% of the resources are stored in a highly efficient, distributed key-value storage. The content itself is created with common, well-known frameworks like the beautiful Ruby on Rails and the whole system can be monitored using a website that updates in real-time. The universal design goals for the framework are examined using load tests and experiments that put a light on the latest system limits, I/O strategies, protocols and caching technologies.
5. 1
Ultra Large Web Applications
Super Scale Systems
6. 1
How large?
5 trillion 235 billion 943 million Facebook
310 billion 390 million Twitter
2,078 million youTube
170 million Google+
160 million LinkedIn
7. 1
How much do they grow per day?
4,335 million Facebook
341 million Twitter
1 million youTube
500 thousand Google+
50 thousand LinkedIn
8. Structural Load
1
Scaleability!
Bondi (2000)
Space Distance
9. Knowledge Stack
Database Request
Limits Limits
Operating Integer
Figures Limits Framework
System Limits
Key
Principles
Limits
Concurrency
Super Scale
Systems
Scalability
Sync
I/O
Strategies
Async
API
3D-Hosting
Application
Scales HTTP
Architecture
Protocols &
Design Technologies
Goals Server-Sent
Modules Events
Demo Caching
Web
Sockets
Structural Scalability
Load Scalability
Techno- Tailor vs.
logies Superstore
10. Knowledge Stack
Database Request
Limits Limits
Operating Integer
Figures Limits Framework
System Limits
Key
Principles
Limits
Concurrency
Super Scale
Systems
Scalability
Sync
I/O
Strategies
Async
API
3D-Hosting
Application
Scales HTTP
Architecture
Protocols &
Design Technologies
Goals Server-Sent
Modules Events
Demo Caching
Web
Sockets
Structural Scalability
Load Scalability
Techno- Tailor vs.
logies Superstore
12. 2
Infinitely Increment an Integer
Java Overflow
C Overflow
Ruby Running and running and ...
Danger! Overflows happen without notice!
13. 2
Database Rows and Query Times
Total Request Maximum 1000ms (Nielson)
Total Query Maximum 500ms
Single Query Time 133ms at 3 Queries
3,632,492 Dedicated DB
1,441,419 Rows Servers for Facebook
25. TCP Handshake
Terminate Connection
HTTP 1.0
4
40ms Processing 20ms Latency
3 Requests Each 160ms Total 480ms
Server
SYN 1
ACK 1
FIN 1
FIN-ACK 1
SYN 2
ACK 2
FIN 2
FIN-ACK 2
SYN 3
ACK 3
FIN 3
FIN-ACK 3
Client 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400 420 Time in ms
Open 1 Request 1 Close 1 Open 2 Request 2 Close 2 Open 3 Request 3 Close 3
26. HTTP 1.1
Keep-Alive
4
Pipelining
3 Requests Each 160ms Total 320ms
Server
SYN
ACK
FIN
FIN-ACK
Client 40 60 80 100 120 140 160 180 200 220 240 260 280 Time in ms
TCP Handshake Request 1 Request 2 Request 3 TCP Termination
27. HTTP 1.1
Keep-Alive
4
Pipelining
3 Requests Each 160ms Total 160ms
Server
SYN
ACK
FIN
FIN-ACK
Client 40 60 80 100 120 140 Time in ms
TCP Handshake Request 1 Request 2 Request 3 TCP Termination
28. 4
Server-Sent Events vs. WebSockets
Push only Bidirectional
DOM Events Publish/Subscribe
Same Origin Policy Any Origin
45. Application
How does the code change? (1) Update
6
# GET /tracks/1
def show
@track = Track.find(params[:id])
render "show"
end
# GET /tracks/1
def show
@track = Track.find(params[:id])
Scales.push :html => render("show"), :to => "/tracks/#{@track.id}"
end
46. Application
How does the code change? (2) Update
6
# PUT /tracks/1
def update
@track = Track.find(params[:id])
if @track.update_attributes(params[:track])
redirect_to @track, notice: 'Track was successfully updated.'
else
render action: "edit"
end
end
# PUT /tracks/1
def update
@track = Track.find(params[:id])
if @track.update_attributes(params[:track])
Scales.update "/tracks/#{@track.id}", "/tracks/#{@track.id}/edit", "/tracks", :format => :html
redirect_to @track, notice: 'Track was successfully updated.'
else
render action: "edit"
end
end