BASE64编码的图片在网页中的显示【转】 06月27日


摘编自: 原作者:mfcai 1.为什么 [...]

Thrift vs. Protocol Buffers 06月23日

Google recently released its Protocol Buffers as open source. About a year ago, Facebook released a similar product called Thrift. I’ve been comparing them; here’s what I’ve found:

Thrift Protocol Buffers
Backers Facebook, Apache (accepted for incubation) Google
Bindings C++, Java, Python, PHP, XSD, Ruby, C#, Perl, Objective C, Erlang, Smalltalk, OCaml, and Haskell C++, Java, Python
(Perl, Ruby, and C# under discussion)
Output Formats Binary, JSON Binary
Primitive Types bool
16/32/64-bit integersdouble
byte sequence
bool32/64-bit integers
byte sequence

“repeated” properties act like lists

Enumerations Yes Yes
Constants Yes No
Composite Type struct message
Exception Type Yes No
Documentation So-so Good
License Apache BSD-style
Compiler Language C++ C++
RPC Interfaces Yes Yes
RPC Implementation Yes No
Composite Type Extensions No Yes

Overall, I think Thrift wins on features and Protocol Buffers win on documentation. Implementation-wise, they’re quite similar. Both use integer tags to identify fields, so you can add and remove fields without breaking existing code. Protocol Buffers support variable-width encoding of integers, which saves a few bytes. (Thrift has an experimental output format with variable-width ints.)

The major difference is that Thrift provides a full client/server RPC implementation, whereas Protocol Buffers only generate stubs to use in your own RPC system.

Update July 12, 2008: I haven’t tested for speed, but from a cursory examination it seems that, at the binary level, Thrift and Protocol Buffers are very similar. I think Thrift will develop a more coherent community now that it’s under Apache incubation. It just moved to a new web site and mailing list, and the issue trackeris active.

Kyoto Cabinet 基本规格书【转】 06月20日

如果你知道 Tokyo Cabinet ,那么就应该知道 Kyoto Cabinet,因为他们都是同一个作者(平林幹雄)开发出来的 Key-Value 数据库。

Kyoto Cabinet:a straightforward implementation of DBM,主页: ,演示文稿: 。

Tokyo Cabinet:a modern implementation of DBM,主页:

以下Tokyo Cabinet简称为TC, Kyoto Cabinet简称为KC,本文主要对KC做介绍。

以下内容的英文原文来自: (更多…)

浅谈Facebook的服务器架构(组图)【转】 06月13日


导读:毫无疑问,作为全球最领先的社交网络,Facebook的高性能集群系统承担了海量数据的处理,它的服务器架构 [...]