mpi, erlang and the web

50
parallel programming why does it matter to web development

Upload: lenz-gschwendtner

Post on 30-Oct-2014

4.944 views

Category:

Technology


1 download

DESCRIPTION

slides from my talk at LCA2010 in Wellington about how to scale web services and why parallel programming and open standards matter

TRANSCRIPT

Page 1: MPI, Erlang and the web

parallel programmingwhy does it matter to web development

Page 2: MPI, Erlang and the web

who i am

• german expat in NZ

• text editor addict since age 14

• CTO ideegeo Group Limited

• erlounge Wellington

Page 3: MPI, Erlang and the web

erlounge Wellington

• diverse crowd

• more about parallel programming

• once a month

Page 4: MPI, Erlang and the web

todays topics

• message passing infrastructure

• erlang

• open standards

Page 5: MPI, Erlang and the web

scale web based projects

• one server

• separate functionality (some server)

• load balance (some more server)

Page 6: MPI, Erlang and the web

loadbalance

• web servers is easy

• databases is harder

• business logic often not possible

Page 7: MPI, Erlang and the web

the problem

• shared state

• shared data

• waiting for other processes

Page 8: MPI, Erlang and the web

in general terms

Page 9: MPI, Erlang and the web

global locking

Page 10: MPI, Erlang and the web
Page 11: MPI, Erlang and the web

sounds familiar?looks like a parallel programming issue to me

Page 12: MPI, Erlang and the web

i tried to solve ...

• scalability issues

• scale to many servers

• asynchronous processes

• process queues

• callback queues

Page 13: MPI, Erlang and the web

i wrote

• a simple perl based environment

• my own message queue

• my own messaging format

Page 14: MPI, Erlang and the web

what i actually didwithout knowing it ...

Page 15: MPI, Erlang and the web

i wrote a MPIok, a quite basic message passing infrastructure but it

was one

Page 16: MPI, Erlang and the web
Page 17: MPI, Erlang and the web

and to my big surprise

Page 18: MPI, Erlang and the web

this thing workedbetter as expected

Page 19: MPI, Erlang and the web

... but ...

Page 20: MPI, Erlang and the web

i found erlang

Page 21: MPI, Erlang and the web

erlang ...

• is a functional language

• has a built in MPI

• share nothing approach

Page 22: MPI, Erlang and the web

feels like heaven on earth

Page 23: MPI, Erlang and the web
Page 24: MPI, Erlang and the web

issues

• not compatible to my existing stuff

• feel the pain of custom protocols

• rewrite or compat layer or ...

Page 25: MPI, Erlang and the web

the usual thing happened

Page 26: MPI, Erlang and the web

... i left it aside ...

Page 27: MPI, Erlang and the web

... meanwhile ...

Page 28: MPI, Erlang and the web

i started to play with

• CouchDB

• RabbitMQ

• ejabberd

Page 29: MPI, Erlang and the web

all erlangand open standards based

Page 30: MPI, Erlang and the web

the more I playedthe more I wished I could use them

Page 31: MPI, Erlang and the web

the inevitable happened

Page 32: MPI, Erlang and the web

iteration two

Page 33: MPI, Erlang and the web
Page 34: MPI, Erlang and the web

AMQP

Page 35: MPI, Erlang and the web

open standard

• backed by major players

• around for some years

• RabbitMQ (erlang based)

Page 36: MPI, Erlang and the web

JSON

Page 37: MPI, Erlang and the web

open format

• used by many

• small footprint

• easy to read for humans and computers

Page 38: MPI, Erlang and the web

erlang

Page 39: MPI, Erlang and the web

fast and small

• compared to perl/php/ruby/...

• scales linear to 32 cores

• distributing processes is easy

Page 40: MPI, Erlang and the web

perl

Page 41: MPI, Erlang and the web

still in the system

• for compatibility

• for string processing

• for stuff where it makes sense

Page 42: MPI, Erlang and the web

[your lang here]

Page 43: MPI, Erlang and the web

language independent

• JSON is available in most languages

• AMQP is available in all major languages

• pick the one that makes sense

Page 44: MPI, Erlang and the web
Page 45: MPI, Erlang and the web

internet architectures

• scaling to many servers

• loadbalancing

• reducing global locks

Page 46: MPI, Erlang and the web

multicore programming

• scaling to many cores

• loadbalancing

• reducing global locks

Page 47: MPI, Erlang and the web

do we solve simmilar problems here?

Page 48: MPI, Erlang and the web

where to find me

• @norbu09

• http://norbu09.org

• http://github.com/norbu09

• http://slideshare.net/norbu09

Page 49: MPI, Erlang and the web