zoukankan      html  css  js  c++  java
  • Thrift vs. Protocol Buffers

    http://incubator.apache.org/thrift/

    http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking

    http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/overview.html

    简介

    Thrift Facebook 的核心框架之一,使不同的开发语言开发的系统可以通过该框架实现彼此的通信,类似于 webservice ,但是 Thrift 提供了近乎变态的效率和开发的方便性,是 webservice 所不能比拟的。给分布式开发带来了极大的方便。但是这柄利器也有一些不完美。

     

    问题

    首先文档相当的少,只有一个 wiki 网站提供相应的帮助。这对于 Thrift 的推广极为不利。

    其次框架本身实现有一些缺陷,就 Thrift java 部分来说,没有提供连接池的支持,对 RPC 的调用效率有所影响。

    对于文档稀少的问题,只能是通过一些 Thrift 的开发者和使用者多供献一些自己的心得来解决。这得需要一个过程。而连接池的问题的解决则可以快速一些。

             提到池一般做过 Java 开发的肯定会想到 ObjectPool Apache Commons 项目确实给我们的开发得来了很大的便利性,其中的 pool 项目正是我们实现 thrift 连接池的基础,当然也少不了神器 spring framework

    hrift

      thrift是一种可伸缩的跨语言服务的发展软件框架。它结合了功能强大的软件堆栈的代码生成引擎,以建设服务,工作效率和无缝地与C + +,C#,Java,Python和PHP和Ruby结合。thrift是facebook开发的,我们现在把它作为开源软件使用。thrift允许你定 义一个简单的定义文件中的数据类型和服务接口。以作为输入文件,编译器生成代码用来方便地生成RPC客户端和服务器通信的无缝跨编程语言。

    Protocol Buffers

      Protocol BuffersGoogle 公司开发的一种数据描述语言,类似于XML 能够将结构化数据序列化,可用于数据存储、通信协议等方面。现阶段支持C++、JAVA、Python等三种编程语言。   为什么不只用XML? 同XML相比,Protocol buffers在序列化结构化数据方面有许多优点(google官方提出):   ·更简单   ·数据描述文件只需原来的1/10至1/3   ·解析速度是原来的20倍至100倍   ·减少了二义性   ·生成了更容易在编程中使用的数据访问类   google大概是今天(08年7月8号)将其作为开源项目对外公布,说是后续还要开源的项目有不少都会用到Protocol Buffers。 #bk-album-collection-box-1708160 { 687px; height: 228px; border-right: 1px solid rgb(198, 225, 245); border- 2px 1px 1px; border-style: solid; border-color: rgb(38, 139, 215) rgb(198, 225, 245) rgb(198, 225, 245); margin-bottom: 30px; overflow: hidden; }.bacb-head { height: 28px; background-color: rgb(245, 251, 255); padding-left: 10px; position: relative; }.bacb-title { font-size: 14px; font-weight: bold; line-height: 28px; }.bacb-more { text-decoration: none; position: absolute; font-size: 12px; line-height: 1; top: 8px; right: 8px; padding-right: 11px; background: url("http://img.baidu.com/img/baike/s/arr.gif") no-repeat scroll 54px -22px transparent; }.bacb-more:hover { text-decoration: none; }#bacb-left-btn-1708160, .bacb-window-outer, #bacb-right-btn-1708160 { float: left; }#bacb-left-btn-1708160, #bacb-right-btn-1708160 { display: block; text-decoration: none; border: 1px solid rgb(255, 255, 255); 17px; height: 53px; background: url("http://img.baidu.com/img/baike/bkalbumbtn.gif") no-repeat scroll 0% 0% transparent; cursor: default; }#bacb-left-btn-1708160 { margin: 59px 3px 0pt 6px; background-position: 3px 16px; }#bacb-right-btn-1708160 { margin: 59px 5px 0pt 6px; background-position: -27px 16px; }#bacb-left-btn-1708160.enable:hover { background-position: -61px 16px; border: 1px solid rgb(221, 221, 221); cursor: pointer; }#bacb-right-btn-1708160.enable:hover { background-position: -91px 16px; border: 1px solid rgb(221, 221, 221); cursor: pointer; }.bacb-window-outer { 628px; height: 185px; position: relative; overflow: hidden; margin-top: 15px; }#bacb-window-inner-1708160 { position: absolute; top: 0pt; left: 0pt; padding-left: 6px; }#bacb-window-inner-1708160 .item { float: left; 156px; height: 195px; }#bacb-window-inner-1708160 .img { height: 145px; position: relative; }#bacb-window-inner-1708160 .img .b1, #bacb-window-inner-1708160 .img .b2, #bacb-window-inner-1708160 .img .b3, #bacb-window-inner-1708160 .img .img-wrapper { position: absolute; background-color: rgb(255, 255, 255); }#bacb-window-inner-1708160 .img .b1 { left: 0pt; bottom: 0pt; border: 1px solid rgb(205, 205, 205); }#bacb-window-inner-1708160 .img .b2 { left: 3px; bottom: 3px; border: 1px solid rgb(205, 205, 205); }#bacb-window-inner-1708160 .img .b3 { left: 6px; bottom: 6px; border: 1px solid rgb(170, 170, 170); }#bacb-window-inner-1708160 .img .img-wrapper { left: 9px; bottom: 9px; display: block; text-decoration: none; line-height: 1px; }#bacb-window-inner-1708160 .item .desc { text-align: center; font-family: 宋体; 145px; margin-top: 7px; font-size: 12px; line-height: 1; }#bacb-window-inner-1708160 .item .count { color: rgb(153, 153, 153); white-space: nowrap; }
    扩展阅读:
  • 相关阅读:
    Qt中将QTableView中的数据导出为Excel文件
    QTableView另类打印解决方案(复用render函数去解决print问题)
    [网络]_[批量下载网站文件]
    Codecs是以plugin的形式被调用的(显示中文的codec plugin文件是qcncodecs4.dll),可静态载入和动态载入
    Qt的Model/View Framework解析(数据是从真正的“肉(raw)”里取得,Model提供肉,所以读写文件、操作数据库、网络通讯等一系列与数据打交道的工作就在model中做了)
    MinGW 编译zlib、libpng、libjpeg、libcurl等(全都是Qt项目)
    Move WriteBuffer ReadBuffer String
    Delphi调试DLL 不能调试 不能进入调试 注意!!!
    ssh三大框架,三层架构 整合测试!完整分页代码,JdbcTemplate等测试,存储过程调用,留着以后复习吧
    Delphi 的动态数组
  • 原文地址:https://www.cnblogs.com/kex1n/p/2286436.html
Copyright © 2011-2022 走看看