SlideShare una empresa de Scribd logo
1 de 32
(loose|tight)
couplings in Erlang

  4th Tokyo Erlang Workshop
     in Aoyama, 2010/2/26
           @kuenishi
       http://creativecommons.org/licenses/by-sa/2.1/jp/
S O A
SOA   :
tightly coupled     loosely coupled

                               generalized
Pros       fast            failure separation
                                extensible

          specialized
Cons   failure companion          slow
        less extensible
fast

         tightly
                           ideal
         coupled

                                    standard
specialized

                          loosely
         useless
                          coupled



                   slow
BERT/BERT-RPC
Erlang Serialization Specs,

  with extended specs for RPC,
     --{call, Module, Function, Arguments}
     --> {reply, { some, term, Value }}



Binary ERlang Term,

Older than any of below;

  Thrift, Protocol Buffers, Avro,
  MsgPack...
BERT/BERT-RPC cont’d

 Older than any of below;

   Thrift, Protocol Buffers, Avro,
   MsgPack...

 Various Implementations

   C++, Clojure, Erlang, Factor (?),
   Go, Haskell, JavaScript, Python,
   Ruby, Scala.
How to use BERT in C
 #include “ei.h”

 INCLUDES= -I$(EI)/include

 LDFLAGS= -L$(EI)/lib -lei

 EILIB= `code:lib_dir(erl_interface).`



 erl_interface.h is deprecated.
Erlang -> Java


JInterface,

included in OTP release package by
default,

vice versa.
C -> Erlang


C node,

CORBA (no way!),

any other loose-coupling interface.
Erlang -> C
With BERT,

There are 4 ways->

  C node,

  Port Driver,

  Linked-in Driver,

  NIF.
C node
     A process behaves like an Erlang node,

     BERT/TCP connected,

     Failure doesn’t involve the other.


main(){
   ...               TCP         Erlang
        C node
  ...                             node
}
Port Driver
==Popen3,

BERT/stdin/stdout connected,

tolerant for Child process’ failure.

            fork/exec

              stdin        Erlang
any CUI
                          process
             stdout
Linked-in Driver
in-process erlang-port,

  % acts like an Erlang process

  % Message can be sent/recv’d,

less failure-separeted.
                              Erlang
                             process

                           output(..){
     ?DEMO.                 ... }
Native Interface
     Functions

Since R13B03, Beta,

Built-in code runs inside ERTS,

almost hacking ERTS,          Erlang
                             process
Nothing separated.
                           hello(..){
                            ... }
NIF               fast

             tightly
                                ideal
             coupled
          Linked-in Driver

                                           standard
specialized                  Port Driver

                               loosely
            useless
                               coupled
                                    C node



                      slow
Examples:
Erlang TC drivers
tcerl

Pioneer in TC-Erlang!

Port driver,

“I couldn’t make it work”, - matthew,

seems not being maintained.
Toke

Most famous in TC-Erlang,

Linked-in driver,

Simple: just what matthew/LShift wants,

to be used in RabbitMQ?.
Yatce

Made in Japan by me,

Linked-in driver (0.10) / NIF (0.20),

interface based on tokyocabinet.idl,

maybe fastest...(see graphs)
Yatce 0.20             fast

              tightly
                                ideal
              coupled
                 Toke

                                           standard
specialized                     tcerl

                               loosely
              useless
                               coupled??



                        slow
Comparison
less-related
     Conclusion

all these technologies
     are based on
Erlang Binary format.
      It’s great.
Any Questions?
          or
come on to the party
     and ask me!
References
ERTS: Interoperability tutorial guide
      http://www.erlang.org/doc/tutorial/overview.html

BERT/BERT-RPC
      http://github.com/blog/531-introducing-bert-and-bert-rpc

      http://bert-rpc.org/

Erlang external term format
      http://erlang.org/doc/apps/erts/erl_ext_dist.html

NIF
      http://erlang.org/doc/man/erl_nif.html

Toke, vs tcerl
      http://bit.ly/8nPhm2

Erlang external term format

Más contenido relacionado

La actualidad más candente

You got ur Erlang in my Ruby
You got ur Erlang in my RubyYou got ur Erlang in my Ruby
You got ur Erlang in my Ruby
elliando dias
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
yohanbeschi
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
 
Java bytecode and classes
Java bytecode and classesJava bytecode and classes
Java bytecode and classes
yoavwix
 
Ee325 cmos design lab 7 report - loren k schwappach
Ee325 cmos design   lab 7 report - loren k schwappachEe325 cmos design   lab 7 report - loren k schwappach
Ee325 cmos design lab 7 report - loren k schwappach
Loren Schwappach
 
EE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers LabEE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers Lab
Loren Schwappach
 
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Konstantin Sorokin
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
Malik Tauqir Hasan
 

La actualidad más candente (20)

You got ur Erlang in my Ruby
You got ur Erlang in my RubyYou got ur Erlang in my Ruby
You got ur Erlang in my Ruby
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
 
Flash memory
Flash memoryFlash memory
Flash memory
 
Static analysis for perl
Static analysis for perlStatic analysis for perl
Static analysis for perl
 
PyPy 1.2: snakes never crawled so fast
PyPy 1.2: snakes never crawled so fastPyPy 1.2: snakes never crawled so fast
PyPy 1.2: snakes never crawled so fast
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
 
JAVA BYTE CODE
JAVA BYTE CODEJAVA BYTE CODE
JAVA BYTE CODE
 
Parallel Programming
Parallel ProgrammingParallel Programming
Parallel Programming
 
Java bytecode and classes
Java bytecode and classesJava bytecode and classes
Java bytecode and classes
 
Python coroutine
Python coroutinePython coroutine
Python coroutine
 
Ee325 cmos design lab 7 report - loren k schwappach
Ee325 cmos design   lab 7 report - loren k schwappachEe325 cmos design   lab 7 report - loren k schwappach
Ee325 cmos design lab 7 report - loren k schwappach
 
The dark side of Ruby, or Learn functional programming with Ruby
The dark side of Ruby, or Learn functional programming with RubyThe dark side of Ruby, or Learn functional programming with Ruby
The dark side of Ruby, or Learn functional programming with Ruby
 
EE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers LabEE312 Embedded Microcontrollers Lab
EE312 Embedded Microcontrollers Lab
 
Modules and ports in Verilog HDL
Modules and ports in Verilog HDLModules and ports in Verilog HDL
Modules and ports in Verilog HDL
 
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
 
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
 
Whats new in Java 7
Whats new in Java 7Whats new in Java 7
Whats new in Java 7
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
 
Syntutic
SyntuticSyntutic
Syntutic
 

Destacado

LT on Python Hackathon #2
LT on Python Hackathon #2LT on Python Hackathon #2
LT on Python Hackathon #2
UENISHI Kota
 
Db tech show - hivemall
Db tech show - hivemallDb tech show - hivemall
Db tech show - hivemall
Makoto Yui
 
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
Funada Yasunobu
 

Destacado (20)

LT on Python Hackathon #2
LT on Python Hackathon #2LT on Python Hackathon #2
LT on Python Hackathon #2
 
[db tech showcase Tokyo 2015] C14:30万のユーザ部門を抱える日立、情シスの「理想と現実」 by 株式会社日立製作所 情報...
[db tech showcase Tokyo 2015] C14:30万のユーザ部門を抱える日立、情シスの「理想と現実」 by 株式会社日立製作所 情報...[db tech showcase Tokyo 2015] C14:30万のユーザ部門を抱える日立、情シスの「理想と現実」 by 株式会社日立製作所 情報...
[db tech showcase Tokyo 2015] C14:30万のユーザ部門を抱える日立、情シスの「理想と現実」 by 株式会社日立製作所 情報...
 
[db tech showcase Tokyo 2015] B34:データの仮想化を具体化するIBMのロジカルデータウェアハウス by 日本アイ・ビー・エ...
[db tech showcase Tokyo 2015] B34:データの仮想化を具体化するIBMのロジカルデータウェアハウス by 日本アイ・ビー・エ...[db tech showcase Tokyo 2015] B34:データの仮想化を具体化するIBMのロジカルデータウェアハウス by 日本アイ・ビー・エ...
[db tech showcase Tokyo 2015] B34:データの仮想化を具体化するIBMのロジカルデータウェアハウス by 日本アイ・ビー・エ...
 
Couchbase introduction-20150611
Couchbase introduction-20150611Couchbase introduction-20150611
Couchbase introduction-20150611
 
Mongodb x business
Mongodb x businessMongodb x business
Mongodb x business
 
Db tech showcase2015
Db tech showcase2015Db tech showcase2015
Db tech showcase2015
 
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
 
Db tech show - hivemall
Db tech show - hivemallDb tech show - hivemall
Db tech show - hivemall
 
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
 
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
 
gen_paxos
gen_paxosgen_paxos
gen_paxos
 
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
 
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
 
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
 
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジーDBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
 
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
 
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
 
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
 
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
 
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
 

Similar a TEW4 Yatce deprecated slides

Os Worthington
Os WorthingtonOs Worthington
Os Worthington
oscon2007
 
Erlang及其应用
Erlang及其应用Erlang及其应用
Erlang及其应用
Feng Yu
 

Similar a TEW4 Yatce deprecated slides (20)

Using Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled WorldUsing Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled World
 
Erlangfactory
ErlangfactoryErlangfactory
Erlangfactory
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
 
How to use Ruby code inside Elixir
How to use Ruby code inside ElixirHow to use Ruby code inside Elixir
How to use Ruby code inside Elixir
 
Programming FPGA in electronic systems
Programming FPGA in electronic systemsProgramming FPGA in electronic systems
Programming FPGA in electronic systems
 
Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)
 
Elixir
ElixirElixir
Elixir
 
Beam me up, Scotty
Beam me up, ScottyBeam me up, Scotty
Beam me up, Scotty
 
Ruby
RubyRuby
Ruby
 
Erlang
ErlangErlang
Erlang
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
 
Erlang及其应用
Erlang及其应用Erlang及其应用
Erlang及其应用
 
fpga1 - What is.pptx
fpga1 - What is.pptxfpga1 - What is.pptx
fpga1 - What is.pptx
 
Introduction to FPGAs
Introduction to FPGAsIntroduction to FPGAs
Introduction to FPGAs
 
Nobuya Okada presentation
Nobuya Okada presentationNobuya Okada presentation
Nobuya Okada presentation
 
Transformer Zoo
Transformer ZooTransformer Zoo
Transformer Zoo
 
Jython: Integrating Python and Java
Jython: Integrating Python and JavaJython: Integrating Python and Java
Jython: Integrating Python and Java
 
Erjang
ErjangErjang
Erjang
 
User manual ramon
User manual  ramon User manual  ramon
User manual ramon
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_future
 

TEW4 Yatce deprecated slides

  • 1. (loose|tight) couplings in Erlang 4th Tokyo Erlang Workshop in Aoyama, 2010/2/26 @kuenishi http://creativecommons.org/licenses/by-sa/2.1/jp/
  • 2.
  • 4. SOA :
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. tightly coupled loosely coupled generalized Pros fast failure separation extensible specialized Cons failure companion slow less extensible
  • 12. fast tightly ideal coupled standard specialized loosely useless coupled slow
  • 13. BERT/BERT-RPC Erlang Serialization Specs, with extended specs for RPC, --{call, Module, Function, Arguments} --> {reply, { some, term, Value }} Binary ERlang Term, Older than any of below; Thrift, Protocol Buffers, Avro, MsgPack...
  • 14. BERT/BERT-RPC cont’d Older than any of below; Thrift, Protocol Buffers, Avro, MsgPack... Various Implementations C++, Clojure, Erlang, Factor (?), Go, Haskell, JavaScript, Python, Ruby, Scala.
  • 15. How to use BERT in C #include “ei.h” INCLUDES= -I$(EI)/include LDFLAGS= -L$(EI)/lib -lei EILIB= `code:lib_dir(erl_interface).` erl_interface.h is deprecated.
  • 16. Erlang -> Java JInterface, included in OTP release package by default, vice versa.
  • 17. C -> Erlang C node, CORBA (no way!), any other loose-coupling interface.
  • 18. Erlang -> C With BERT, There are 4 ways-> C node, Port Driver, Linked-in Driver, NIF.
  • 19. C node A process behaves like an Erlang node, BERT/TCP connected, Failure doesn’t involve the other. main(){ ... TCP Erlang C node ... node }
  • 20. Port Driver ==Popen3, BERT/stdin/stdout connected, tolerant for Child process’ failure. fork/exec stdin Erlang any CUI process stdout
  • 21. Linked-in Driver in-process erlang-port, % acts like an Erlang process % Message can be sent/recv’d, less failure-separeted. Erlang process output(..){ ?DEMO. ... }
  • 22. Native Interface Functions Since R13B03, Beta, Built-in code runs inside ERTS, almost hacking ERTS, Erlang process Nothing separated. hello(..){ ... }
  • 23. NIF fast tightly ideal coupled Linked-in Driver standard specialized Port Driver loosely useless coupled C node slow
  • 25. tcerl Pioneer in TC-Erlang! Port driver, “I couldn’t make it work”, - matthew, seems not being maintained.
  • 26. Toke Most famous in TC-Erlang, Linked-in driver, Simple: just what matthew/LShift wants, to be used in RabbitMQ?.
  • 27. Yatce Made in Japan by me, Linked-in driver (0.10) / NIF (0.20), interface based on tokyocabinet.idl, maybe fastest...(see graphs)
  • 28. Yatce 0.20 fast tightly ideal coupled Toke standard specialized tcerl loosely useless coupled?? slow
  • 30. less-related Conclusion all these technologies are based on Erlang Binary format. It’s great.
  • 31. Any Questions? or come on to the party and ask me!
  • 32. References ERTS: Interoperability tutorial guide http://www.erlang.org/doc/tutorial/overview.html BERT/BERT-RPC http://github.com/blog/531-introducing-bert-and-bert-rpc http://bert-rpc.org/ Erlang external term format http://erlang.org/doc/apps/erts/erl_ext_dist.html NIF http://erlang.org/doc/man/erl_nif.html Toke, vs tcerl http://bit.ly/8nPhm2 Erlang external term format

Notas del editor