Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

RPC protocols

477 views

Published on

2011년 세미나 자료

Published in: Technology
  • Be the first to comment

  • Be the first to like this

RPC protocols

  1. 1. RPC Protocols HAN O SEOK
  2. 2. RPC • Remote Procedure Calls • Client-Server based Application
  3. 3. History • Xerox - Courier • Apollo Computer - Network Computing Architecture • RPC ver. 1 (RFC 1050) • RPC ver. 2 (RFC 5531)
  4. 4. How Works Client Server call rpc function call service service executes request completes return reply progrma continues execute requests
  5. 5. RPC Protocols SOAP XML-RPC JSON-RPC MSMQ DTC RMIThrift Protocol Buffers AVRO .NET Remoting CORBA Pyro DRb
  6. 6. Interface Layer • High Level Layer - Existed API Call • Middle Level Layer - Create API By rpcgen Compiler • Low Level Layer - Create RCP API
  7. 7. Network Layer & Data XML ETC JSON HTTP SOAP XML-RPC XML-JSON avro TCP/IP thrift ProtoBuf thrift avro Named Pipe IPX
  8. 8. XML-RPC • HTTP Based POST Request • Contents of Large Size • Easy Implementation
  9. 9. Thrift • Facebook (By X-Googler) • Numbers of Language Support C++, C#, Java, Erlang, Haskell, Objective C, Perl, PHP, Python, Ruby, Squeak Javascript, Node.js, Smalltalk, OCaml
  10. 10. Thrift on Java • Ivy (http://ant.apache.org/ivy/) • lib-thrift • Support Thrift Server & Client
  11. 11. Thrift Type • Base Types boolean, byte, i16, i32, i64 (Signed Integer) double, string • Structs • Containers list, set, map • Exceptions • Services
  12. 12. Thrift Stub Example
  13. 13. Thrift Stub Example
  14. 14. Thrift Stub Example
  15. 15. Thrift Request • JSONProtocol [1,”hello”,1,2,{“1”:”str”:hanoseok”}}] • SimpleJSONProtocol [“hello”,1,1,{“name”:”hanoseok”}] • CompactProtocol ?hellohanoseok • BinaryProtocol
  16. 16. Avro • HTTP, UDP,TCP Supports • JSON • Support Languages C, C++, Java, Python, Ruby, PHP
  17. 17. Avro differs • Dynamic Typing - without code generation • Untagged data - smaller serialization size by less type information
  18. 18. Avro Files • .avpr : Protocol File • .avsc : Schema File • .genavro : Generate Avro File
  19. 19. Avro Stub Example • Create Protocol File Using genavro File
  20. 20. Avro Stub Example • Create Java Stup Using Protocol File
  21. 21. Avro Stub Example
  22. 22. Protocol Buffers • ProtoBuf Runtime Only provides serialization and deserialization • Just generate STUB • Support Languages : C++, Java, Python
  23. 23. ProtoBuf Stub Example
  24. 24. ProtoBuf Stub Example
  25. 25. • Thrift Cassandra, HBase, Evernote API, Facebook • Avro Cassandra, HBase • Protocol Buffers Google Data Communications, Google App Engine USING
  26. 26. Comparison • Language Support : Thrift > Avro >ProtoBuf • Scalability : ProtoBuf > Thrift > Avro • (De)Serialization Speed : thrift >= ProtoBuf >= Avro • Documenation : ProtoBuf > Avro = Thrift
  27. 27. Performance • https://github.com/eishay/jvm-serializers/wiki/
  28. 28. Thanks

×