thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhan Xu <zhan...@gmail.com>
Subject Evaluation of thrift
Date Wed, 18 Feb 2009 14:06:41 GMT
Dear all,

I am doing evaluation of Thrift to see whether it can fit into our
production development. The following are some evaluation questions
with my answers. Since I'm pretty new to Thrift, I'd like to post my
answers to the mailing list so that experts here can correct me in
case my answers are wrong.

1. Language support:	Does it support C/C++, Java, .NET?  Does it
support JavaScript, ActionScript, or Silverlight? What other languages
does it support?  Can it be extended to new languages?
A: Supported language: C/C++, Java, C#. No Javascript, ActionScript or
Silverlight support. Other supported languages are Perl, Python, Ruby,
Smalltalk, Cocoa, Haskell, OCaml, PHP etc. To extend to other
languages, the thrift code generator should be modified and the
corresponding library for the target language should be created.

2. Message Exchange:	Does it support asynchronous messages or
synchronous send and receive style messaging?  What mechanism is used
to correlate asynchronous messages?  Can synchronous message timeouts
be controlled?
A: Thrift support synchronous messaging only. The timeout value can be
controlled through getter/setter.

3. Fault handling	Does it support custom application level faults?
How are exceptions in service logic handled back at the client?  How
are infrastructure faults handled?
A: Yes, thrift supports custom application level faults/exceptions.
Exceptions are  treated as special struct. The exceptions will be
mapped back to the target language exceptions. Thrift provide logging
mechanism(TFileTransport,StatsProcessor...) to report infrastructure
faults.

4. Extensibility	What are the extensibility points? Can the underlying
transport runtime be replaced with a different layer? Can the
proxy/stub code generator be modified?  Can we define our own base
classes for the generated proxies and stubs?
A: Thrift defines interfaces for TTransport, TProtocol, TProcessor,
TServer. To extend, we need to create classes to implement those
interfaces. The transport runtime can be replaced with a different
layer. However, for each target language, we must provide the
corresponding implementation -- the transportation is handled by
native language instead a common library. The code generator can be
modified. We can not define our own base classes for the generated
proxies and stubs unless we change the generator's code.

5. Service description language		Is the service description language
extensible with our own attributes?  Is it XML based or is it oriented
to a developer?  Is there any tooling for authoring the service
description language?
A: No, we can not extend the IDL with our own attributes. It is RPC
based. No tooling provided.

6. Versioning	How is the versioning of services handled?  Can old
clients interact with new service definitions?  Can new clients
interact with older service definitions?
A: Versioning is provided by defining field version number. However,
it does not provide versioning of the service contract. Old clients
can interact with new service. It's dangerous for new clients to
interact with old service.

7. Data type support	How rich of data type support does it provide?
Does it support "AnyType (Variant)" types?  Does it support complex
types such as lists, sets, and maps?  Does it introduce its own names
for language types or use the intrinsic types of the language?
A: Thrift supports the following types: Base types (bool, byte, i16,
i32, i64,double, string), Special types (binary), Structs without
inheritance, Containers(list, set, map), Exceptions, and Services.
AnyType may be mapped to binary type. It maps these supported types
to the target language's intrinsic types.

Other things to consider:
1) Platform support -- Windows, Linux, Mac, etc.  (Thrift -- C++ does
not work under Win)
2) Security support (Thrift -- nothing)
3) Diagnostics (Thrift -- yes, diagnostics is provided)
4) Reconnection/Takeover support (Thrift -- no, Thrift does not
support reconnection, service take over)

Thanks a lot!

BTW, I would like to say 'Thank you' for all the replies regarding my
previous question about 'Windows support'.

Zhan Xu

Mime
View raw message