maglev: download to deploy - mwrc 2014
DESCRIPTION
MagLev is a Ruby implementation built on top of a mature VM which offers native object persistence. Working with these live objects is awesome - but this image-based development is very different than traditional file-based development. MagLev uses both which has broad reaching effects - from design to deployment.TRANSCRIPT
![Page 1: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/1.jpg)
download to deployJohnnyT
@johnny_t
![Page 2: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/2.jpg)
Who was just
Introduced to Smalltalk
for the first time?
![Page 3: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/3.jpg)
![Page 4: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/4.jpg)
My job is done
The good word
of Smalltalkhas been preached.
Thanks @norelap!
![Page 5: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/5.jpg)
![Page 6: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/6.jpg)
MagLev is an implementation of Ruby which runs on top of the GemStone/S
VM.
What is MagLev?
![Page 7: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/7.jpg)
Before
Ruby
Year 0(1996)
After
Ruby
![Page 8: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/8.jpg)
Year 0(1996)
Matz
Explored theworld of languages
Liked aspects of Perland had visited theIvory Tower of Smalltalk
![Page 9: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/9.jpg)
~10BR(~1986)
Matz
Explored theworld of languages
Liked aspects of Perland had visited theIvory Tower of Smalltalk
![Page 10: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/10.jpg)
18BR(1978)
![Page 11: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/11.jpg)
15BR(1981)
![Page 12: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/12.jpg)
Dan IngallsBYTE Magazine
(1981)
“To be truly object oriented
a system must provide
automatic storage management
(both data and code).”
![Page 13: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/13.jpg)
![Page 14: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/14.jpg)
![Page 15: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/15.jpg)
![Page 16: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/16.jpg)
![Page 17: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/17.jpg)
![Page 18: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/18.jpg)
RUBY_ENGINE“ruby”
![Page 19: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/19.jpg)
rvm 1.9.3
‘puts RUBY_ENGINE’-eruby
“ruby”
MRI
![Page 20: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/20.jpg)
and needs to be preached to the masses
Ruby is awesome!
7AR(2003)
![Page 21: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/21.jpg)
9AR(2005)
DHH
![Page 22: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/22.jpg)
and the land of Java needs some awesome
Ruby is awesome!
12AR(2008)
![Page 23: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/23.jpg)
12AR(2008)
Charles Nutter
![Page 24: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/24.jpg)
Year 0(1996)
JDK v1.0
![Page 25: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/25.jpg)
Why Java?
![Page 26: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/26.jpg)
Threading
![Page 27: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/27.jpg)
RUBY_ENGINE“jruby”
![Page 28: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/28.jpg)
“java”
java jruby-full.jar
‘puts RUBY_ENGINE’-erubyrvm jRuby
![Page 29: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/29.jpg)
let’s go back to our rootsRuby is awesome!
12AR(2008)
![Page 30: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/30.jpg)
12AR(2008)
![Page 31: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/31.jpg)
10BR(1986)
![Page 32: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/32.jpg)
Code
Data
GemStone/S v1.1
![Page 33: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/33.jpg)
OOCL 1.5 billion data objects> 5,800 people in 150 offices globallyFinancial, CS, vendor mgmt, legal, sales
![Page 34: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/34.jpg)
GemStone/S v1.xImprovements from working with OOCL
New classes
![Page 35: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/35.jpg)
Automated trading
![Page 36: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/36.jpg)
GemStone/S v1.y Improvements from working with JP Morgan
New ReducedConflict classes
![Page 37: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/37.jpg)
Install MagLev
Download stone
File in RubyRuby core in the stone
Ruby Core
![Page 38: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/38.jpg)
Data Stores
![Page 39: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/39.jpg)
PostgreSQL
✓ Install✓ Setup
credentials✓ Start daemon
Server Client
login
connection
![Page 40: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/40.jpg)
PostgreSQL
Clientlogin
connection
Execute PL/pgSQL, PL/Perl, PL/Python ...
![Page 41: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/41.jpg)
MagLevClient
login
Shared Page Cache
ClientAttaches to SPCCan execute Ruby as the ‘data manipulation language’
![Page 42: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/42.jpg)
RUBY_ENGINE“maglev”
![Page 43: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/43.jpg)
“maglev”
login
topaz
‘puts RUBY_ENGINE’-erubyrvm jRuby
![Page 44: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/44.jpg)
Object-Relational Impedance Mismatch
![Page 45: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/45.jpg)
Magic, Jobs and Geohashes
Examples
![Page 46: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/46.jpg)
The Hat Trick
![Page 47: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/47.jpg)
hat.rb
![Page 48: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/48.jpg)
rabbit.rb
![Page 49: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/49.jpg)
Abort is not a bad guy
![Page 50: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/50.jpg)
create_hat.rb
![Page 52: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/52.jpg)
JobQueueLet’s persist some blocks
![Page 53: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/53.jpg)
worker.rb
![Page 54: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/54.jpg)
job.rb
![Page 56: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/56.jpg)
Geohashlatitude, longitude => indexable string
![Page 57: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/57.jpg)
Looking at kids of:root cell.
Precision of 1:
Grid size: 8 x 4Cell count: 32
A cell’s approx size:2.5 million km2
~ size of Australia
MWRC is in themiddle left of the root.
GOTO: 9
![Page 58: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/58.jpg)
Looking at kids of:‘9’.
Precision of 2:
Grid size: 32 x 32Cell count: 1024
A cell’s approx size:781k km2
~ size of UK, Spain or Texas
MWRC is in thetop right of 9
GOTO: 9x
![Page 59: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/59.jpg)
Looking at kids of:‘9x’.
Precision of 3:
Grid size: 256 x 128Cell count: 32k
A cell’s approx size:24k km2
~ size of US County
MWRC is in thebottom left of 9x
GOTO: 9x0
![Page 60: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/60.jpg)
Looking at kids of:‘9x0’.
Precision of 4:
Grid size: 1024 x 1024Cell count: 1.04M
A cell’s approx size:760 km2
~ size of large city
MWRC is in thetop center of 9x0
GOTO: 9x0r
![Page 61: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/61.jpg)
Looking at kids of:‘9x0r’.
Precision of 5:
Grid size: 8192 x 4096Cell count: ~33.5M
A cell’s approx size:24 km2
~ US Postal Code
MWRC is in thetop right of 9x0r
GOTO: 9x0ry
![Page 62: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/62.jpg)
Looking at kids of:‘9x0ry’.
Precision of 6:
Grid size: 32768 x 32768Cell count: ~1.07B
A cell’s approx size:0.73 km2
~ Neighborhood
MWRC is in themiddle left of 9x0ry
GOTO: 9x0ryh
![Page 63: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/63.jpg)
Looking at kids of:‘9x0ryh’.
Precision of 7:
Grid size: 262144 x 1310762Cell count: ~34.36B
A cell’s approx size:23k m2
~ Street
MWRC is in thebottom left of 9x0ryh
GOTO: 9x0ryh0
![Page 64: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/64.jpg)
Looking at kids of:‘9x0ryh0’.
Precision of 8:
Grid size: 1048576 x 1048576Cell count: ~1.09T
A cell’s approx size:726 m2
~ House / Office
MWRC is in themiddle of 9x0ryh0
GOTO: 9x0ryh0k
![Page 65: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/65.jpg)
Looking at kids of:‘9x0ryh0k’.
Precision of 9:
Grid size: 8388608 x 4194304Cell count: ~35T
A cell’s approx size:23 m2
~ Room
MWRC is in themiddle of 9x0ryh0k
GOTO: 9x0ryh0kt
![Page 66: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/66.jpg)
Looking at kids of:‘9x0ryh0kt’.
Precision of 10:
Grid size: 33554432 x 33554432Cell count: ~1Q( 1 e+15 )
A cell’s approx size:0.7 m2
~ Room
JohnnyT is speaking on stage at MWRC in the middle right of 9x0ryh0kt
GOTO: 9x0ryh0ktu
![Page 67: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/67.jpg)
Looking at kids of:‘9x0ryh0ktu’.
Precision of 11:
Grid size: 268435456 x 134217728Cell count: ~36Q( 3.6 e+16 )
A cell’s approx size:222 cm2
~ Room
We made it.Just FYI - my children:
Precision of 12:
Grid size: 1073741824 x 1073741824Cell count: ~36Q( 3.6 e+16 )
A cell’s approx size:7 cm2
~ Deck of cards
1073741824
![Page 68: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/68.jpg)
@char
@parent
@kids0
..
.z
Root Cell
‘’
nil
@char
@parent
@kids0
..
.
0
‘0’
..
.9
@char
@parent
@kidsx
..
.
9
‘9’
@char
@parent
@kids0
..
.
9x
‘x’
@char
@parent
@kidsr
..
.
9x0
‘0’
@char
@parent
@kids...
9x0r
‘r’
Geocell Data Structure
![Page 69: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/69.jpg)
geocell.rb
![Page 70: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/70.jpg)
generator.rb
![Page 71: MagLev: Download to Deploy - MWRC 2014](https://reader038.vdocuments.site/reader038/viewer/2022102920/548516c6b4af9f0f0d8b4abf/html5/thumbnails/71.jpg)
Thanks!