maglev: download to deploy - mwrc 2014

71
download to deploy JohnnyT @johnny_t

Upload: john-johnnyt-thornton

Post on 08-Dec-2014

275 views

Category:

Software


2 download

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

download to deployJohnnyT

@johnny_t

Page 2: MagLev: Download to Deploy - MWRC 2014

Who was just

Introduced to Smalltalk

for the first time?

Page 3: MagLev: Download to Deploy - MWRC 2014
Page 4: MagLev: Download to Deploy - MWRC 2014

My job is done

The good word

of Smalltalkhas been preached.

Thanks @norelap!

Page 5: MagLev: Download to Deploy - MWRC 2014
Page 6: MagLev: Download to Deploy - MWRC 2014

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

Before

Ruby

Year 0(1996)

After

Ruby

Page 8: MagLev: Download to Deploy - MWRC 2014

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

~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

18BR(1978)

Page 11: MagLev: Download to Deploy - MWRC 2014

15BR(1981)

Page 12: MagLev: Download to Deploy - MWRC 2014

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
Page 14: MagLev: Download to Deploy - MWRC 2014
Page 15: MagLev: Download to Deploy - MWRC 2014
Page 16: MagLev: Download to Deploy - MWRC 2014
Page 17: MagLev: Download to Deploy - MWRC 2014
Page 18: MagLev: Download to Deploy - MWRC 2014

RUBY_ENGINE“ruby”

Page 19: MagLev: Download to Deploy - MWRC 2014

rvm 1.9.3

‘puts RUBY_ENGINE’-eruby

“ruby”

MRI

Page 20: MagLev: Download to Deploy - MWRC 2014

and needs to be preached to the masses

Ruby is awesome!

7AR(2003)

Page 21: MagLev: Download to Deploy - MWRC 2014

9AR(2005)

DHH

Page 22: MagLev: Download to Deploy - MWRC 2014

and the land of Java needs some awesome

Ruby is awesome!

12AR(2008)

Page 23: MagLev: Download to Deploy - MWRC 2014

12AR(2008)

Charles Nutter

Page 24: MagLev: Download to Deploy - MWRC 2014

Year 0(1996)

JDK v1.0

Page 25: MagLev: Download to Deploy - MWRC 2014

Why Java?

Page 26: MagLev: Download to Deploy - MWRC 2014

Threading

Page 27: MagLev: Download to Deploy - MWRC 2014

RUBY_ENGINE“jruby”

Page 28: MagLev: Download to Deploy - MWRC 2014

“java”

java jruby-full.jar

‘puts RUBY_ENGINE’-erubyrvm jRuby

Page 29: MagLev: Download to Deploy - MWRC 2014

let’s go back to our rootsRuby is awesome!

12AR(2008)

Page 30: MagLev: Download to Deploy - MWRC 2014

12AR(2008)

Page 31: MagLev: Download to Deploy - MWRC 2014

10BR(1986)

Page 32: MagLev: Download to Deploy - MWRC 2014

Code

Data

GemStone/S v1.1

Page 33: MagLev: Download to Deploy - MWRC 2014

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

GemStone/S v1.xImprovements from working with OOCL

New classes

Page 35: MagLev: Download to Deploy - MWRC 2014

Automated trading

Page 36: MagLev: Download to Deploy - MWRC 2014

GemStone/S v1.y Improvements from working with JP Morgan

New ReducedConflict classes

Page 37: MagLev: Download to Deploy - MWRC 2014

Install MagLev

Download stone

File in RubyRuby core in the stone

Ruby Core

Page 38: MagLev: Download to Deploy - MWRC 2014

Data Stores

Page 39: MagLev: Download to Deploy - MWRC 2014

PostgreSQL

✓ Install✓ Setup

credentials✓ Start daemon

Server Client

login

connection

Page 40: MagLev: Download to Deploy - MWRC 2014

PostgreSQL

Clientlogin

connection

Execute PL/pgSQL, PL/Perl, PL/Python ...

Page 41: MagLev: Download to Deploy - MWRC 2014

MagLevClient

login

Shared Page Cache

ClientAttaches to SPCCan execute Ruby as the ‘data manipulation language’

Page 42: MagLev: Download to Deploy - MWRC 2014

RUBY_ENGINE“maglev”

Page 43: MagLev: Download to Deploy - MWRC 2014

“maglev”

login

topaz

‘puts RUBY_ENGINE’-erubyrvm jRuby

Page 44: MagLev: Download to Deploy - MWRC 2014

Object-Relational Impedance Mismatch

Page 45: MagLev: Download to Deploy - MWRC 2014

Magic, Jobs and Geohashes

Examples

Page 46: MagLev: Download to Deploy - MWRC 2014

The Hat Trick

Page 47: MagLev: Download to Deploy - MWRC 2014

hat.rb

Page 48: MagLev: Download to Deploy - MWRC 2014

rabbit.rb

Page 49: MagLev: Download to Deploy - MWRC 2014

Abort is not a bad guy

Page 50: MagLev: Download to Deploy - MWRC 2014

create_hat.rb

Page 52: MagLev: Download to Deploy - MWRC 2014

JobQueueLet’s persist some blocks

Page 53: MagLev: Download to Deploy - MWRC 2014

worker.rb

Page 54: MagLev: Download to Deploy - MWRC 2014

job.rb

Page 56: MagLev: Download to Deploy - MWRC 2014

Geohashlatitude, longitude => indexable string

Page 57: MagLev: Download to Deploy - MWRC 2014

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

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

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

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

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

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

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

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

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

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

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

@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

geocell.rb

Page 70: MagLev: Download to Deploy - MWRC 2014

generator.rb

Page 71: MagLev: Download to Deploy - MWRC 2014

Thanks!