Integrating Erlang with PHP
Upcoming SlideShare
Loading in...5
×
 

Integrating Erlang with PHP

on

  • 9,825 views

Talk for the conference at IPC Spring Edition 2010 - Berlin

Talk for the conference at IPC Spring Edition 2010 - Berlin

Statistics

Views

Total Views
9,825
Views on SlideShare
9,683
Embed Views
142

Actions

Likes
5
Downloads
111
Comments
0

8 Embeds 142

http://phpperformance.de 62
http://www.slideshare.net 41
http://1073.jp 22
http://erlang.1073.jp 13
https://www.mturk.com 1
http://static.slidesharecdn.com 1
http://coderwall.com 1
https://twitter.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Integrating Erlang with PHP Integrating Erlang with PHP Presentation Transcript

  • Integrating Erlang with PHP Alvaro Videla June 2010 - IPC Spring Edition - Berlin Wednesday, June 2, 2010
  • About Me • Lead Developer at TheNetCircle.com • Twitter: @old_sound • Blog: http://obvioushints.blogspot.com/ • PHP Erlang Bridge Core Developer Wednesday, June 2, 2010
  • What’s Erlang? Wednesday, June 2, 2010
  • What’s Erlang? • General Purpose Functional Language Wednesday, June 2, 2010
  • What’s Erlang? • General Purpose Functional Language • Multi Platform Wednesday, June 2, 2010
  • What’s Erlang? • General Purpose Functional Language • Multi Platform • Invented in 1986 at Ericsson Wednesday, June 2, 2010
  • What’s Erlang? • General Purpose Functional Language • Multi Platform • Invented in 1986 at Ericsson • Open Sourced in 1998 Wednesday, June 2, 2010
  • Products written in Erlang Wednesday, June 2, 2010
  • Products written in Erlang • Amazon SimpleDB Wednesday, June 2, 2010
  • Products written in Erlang • Amazon SimpleDB • Ejabberd - XMPP server Wednesday, June 2, 2010
  • Products written in Erlang • Amazon SimpleDB • Ejabberd - XMPP server • RabbitMQ - AMQP Messaging Server Wednesday, June 2, 2010
  • Products written in Erlang • Amazon SimpleDB • Ejabberd - XMPP server • RabbitMQ - AMQP Messaging Server • Riak - Decentralized Key/Value Store Wednesday, June 2, 2010
  • Products written in Erlang • Amazon SimpleDB • Ejabberd - XMPP server • RabbitMQ - AMQP Messaging Server • Riak - Decentralized Key/Value Store • CouchDB - Document Oriented Database Wednesday, June 2, 2010
  • Products written in Erlang • Amazon SimpleDB • Ejabberd - XMPP server • RabbitMQ - AMQP Messaging Server • Riak - Decentralized Key/Value Store • CouchDB - Document Oriented Database • Mochiweb - Lightweight HTTP Servers Wednesday, June 2, 2010
  • What’s in the package? Wednesday, June 2, 2010
  • What’s in the package? • Fault Tolerance Wednesday, June 2, 2010
  • What’s in the package? • Fault Tolerance • Distribution Wednesday, June 2, 2010
  • What’s in the package? • Fault Tolerance • Distribution • Concurrency Wednesday, June 2, 2010
  • What’s in the package? • Fault Tolerance • Distribution • Concurrency • Code Hot Swap Wednesday, June 2, 2010
  • What’s in the package? • Fault Tolerance • Distribution • Concurrency • Code Hot Swap • Mnesia a DDBMS Wednesday, June 2, 2010
  • What’s in the package? • Fault Tolerance • Distribution • Concurrency • Code Hot Swap • Mnesia a DDBMS • OTP Framework Wednesday, June 2, 2010
  • The Language • Single Assignment Wednesday, June 2, 2010
  • The Language • Single Assignment • Controlled Side Effects Wednesday, June 2, 2010
  • The Language • Single Assignment • Controlled Side Effects • Pattern Matching Wednesday, June 2, 2010
  • The Language • Single Assignment • Controlled Side Effects • Pattern Matching • Closures Wednesday, June 2, 2010
  • PHP Integration • PHP Erlang Bridge • C Extension • Converts PHP into a “cnode” Wednesday, June 2, 2010
  • What can I build? Wednesday, June 2, 2010
  • What can I build? • Web Admins for Erlang Systems Wednesday, June 2, 2010
  • What can I build? • Web Admins for Erlang Systems • PHP Session Storage Systems Wednesday, June 2, 2010
  • What can I build? • Web Admins for Erlang Systems • PHP Session Storage Systems • Ad hoc K/V stores Wednesday, June 2, 2010
  • What can I build? • Web Admins for Erlang Systems • PHP Session Storage Systems • Ad hoc K/V stores • Run Map/Reduce Jobs in Erlang Wednesday, June 2, 2010
  • What can I build? • Web Admins for Erlang Systems • PHP Session Storage Systems • Ad hoc K/V stores • Run Map/Reduce Jobs in Erlang • Much more… Wednesday, June 2, 2010
  • RabbitMQ Admin Console Wednesday, June 2, 2010
  • RabbitMQ Admin Console Wednesday, June 2, 2010
  • RabbitMQ Admin Console Wednesday, June 2, 2010
  • RabbitMQ Admin Console Wednesday, June 2, 2010
  • Session Storage • Why? • To ease session data distribution • Be able to add logic to sessions • Several storage backends to choose from Wednesday, June 2, 2010
  • Session Storage: Bitcask • Developed by Basho as a Riak backend • Minimalistic API • Stores data on disk • Easy to Backup and Restore * http://blog.basho.com/2010/04/27/hello,-bitcask/ Wednesday, June 2, 2010
  • Session Storage: Bitcask http://github.com/videlalvaro/phpcask Wednesday, June 2, 2010
  • Session Storage: Bitcask Wednesday, June 2, 2010
  • Session Storage: Bitcask Wednesday, June 2, 2010
  • Session Storage: Bitcask Wednesday, June 2, 2010
  • Session Storage: Bitcask Wednesday, June 2, 2010
  • Ad Hoc K/V Store • Using Erlang Term Storage (ETS) • In memory tables • Adapt the API to suit your needs Wednesday, June 2, 2010
  • Do I have to learn Erlang? Wednesday, June 2, 2010
  • Do I have to learn Erlang? • NO Wednesday, June 2, 2010
  • Do I have to learn Erlang? • NO • Well,Yes, a little will help. Wednesday, June 2, 2010
  • Do I have to learn Erlang? http://learnyousomeerlang.com/ Wednesday, June 2, 2010
  • Installing the extension • grab the code* • phpize • ./configure • make • make install * http://code.google.com/p/mypeb/ Wednesday, June 2, 2010
  • Hello Erlang Wednesday, June 2, 2010
  • Hello Erlang Wednesday, June 2, 2010
  • Connecting to erlang • peb_connect($host, $cookie); Wednesday, June 2, 2010
  • Sending messages • peb_send_by_name($node, $msg, $link); • peb_send_by_pid($node, $msg, $link); Wednesday, June 2, 2010
  • Encoding messages • peb_vencode($format, $data); • peb_encode($format, $data); Wednesday, June 2, 2010
  • Encoding Examples Wednesday, June 2, 2010
  • Formatting Characters • [] List • {} Tuple • ~a Atom • ~s String • ~b Binary • ~i Integer • ~d Double • ~p Pid Wednesday, June 2, 2010
  • Receiving Messages • peb_receive($link); Wednesday, June 2, 2010
  • Decoding Messages • peb_vdecode($msg); • peb_decode($msg); Wednesday, June 2, 2010
  • Decoding Messages • String, Atom, Binary -> String • Tuple, List -> Array • Pid -> Resource • Integer -> Integer • Float -> Double Wednesday, June 2, 2010
  • RPC Calls • peb_rpc($node, $module, $function, $msg); • peb_rpc_to($node, $module, $function, $msg); Wednesday, June 2, 2010
  • Resources • PHP Erlang Bridge: http://code.google.com/p/mypeb/ • Erlang Website: http://www.erlang.org/ • Online Book: http://learnyousomeerlang.com/ • Community Site http://trapexit.org/ • Conferences: http://www.erlang-factory.com/ Wednesday, June 2, 2010
  • Questions? Wednesday, June 2, 2010
  • Thanks! Alvaro Videla http://twitter.com/old_sound TheNetCircle.com Wednesday, June 2, 2010