TEW4 Yatce deprecated slides


Published on


  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

  • TEW4 Yatce deprecated slides

    1. 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. 2. S O A
    3. 3. SOA :
    4. 4. tightly coupled loosely coupled generalized Pros fast failure separation extensible specialized Cons failure companion slow less extensible
    5. 5. fast tightly ideal coupled standard specialized loosely useless coupled slow
    6. 6. 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...
    7. 7. 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.
    8. 8. 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.
    9. 9. Erlang -> Java JInterface, included in OTP release package by default, vice versa.
    10. 10. C -> Erlang C node, CORBA (no way!), any other loose-coupling interface.
    11. 11. Erlang -> C With BERT, There are 4 ways-> C node, Port Driver, Linked-in Driver, NIF.
    12. 12. C node A process behaves like an Erlang node, BERT/TCP connected, Failure doesn’t involve the other. main(){ ... TCP Erlang C node ... node }
    13. 13. Port Driver ==Popen3, BERT/stdin/stdout connected, tolerant for Child process’ failure. fork/exec stdin Erlang any CUI process stdout
    14. 14. 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. ... }
    15. 15. Native Interface Functions Since R13B03, Beta, Built-in code runs inside ERTS, almost hacking ERTS, Erlang process Nothing separated. hello(..){ ... }
    16. 16. NIF fast tightly ideal coupled Linked-in Driver standard specialized Port Driver loosely useless coupled C node slow
    17. 17. Examples: Erlang TC drivers
    18. 18. tcerl Pioneer in TC-Erlang! Port driver, “I couldn’t make it work”, - matthew, seems not being maintained.
    19. 19. Toke Most famous in TC-Erlang, Linked-in driver, Simple: just what matthew/LShift wants, to be used in RabbitMQ?.
    20. 20. Yatce Made in Japan by me, Linked-in driver (0.10) / NIF (0.20), interface based on tokyocabinet.idl, maybe fastest...(see graphs)
    21. 21. Yatce 0.20 fast tightly ideal coupled Toke standard specialized tcerl loosely useless coupled?? slow
    22. 22. Comparison
    23. 23. less-related Conclusion all these technologies are based on Erlang Binary format. It’s great.
    24. 24. Any Questions? or come on to the party and ask me!
    25. 25. 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