<s>
It	O
was	O
developed	O
at	O
Facebook	B-Application
for	O
"	O
scalable	O
cross-language	O
services	O
development	O
"	O
and	O
as	O
of	O
2020	O
is	O
an	O
open	B-Application
source	I-Application
project	O
in	O
the	O
Apache	O
Software	O
Foundation	O
.	O
</s>
<s>
With	O
a	O
remote	B-Operating_System
procedure	I-Operating_System
call	I-Operating_System
(	O
RPC	O
)	O
framework	O
it	O
combines	O
a	O
software	O
stack	O
with	O
a	O
code	O
generation	O
engine	O
to	O
build	O
cross-platform	B-Operating_System
services	O
which	O
can	O
connect	O
applications	O
written	O
in	O
a	O
variety	O
of	O
languages	O
and	O
frameworks	O
,	O
including	O
ActionScript	B-Operating_System
,	O
C	B-Language
,	O
C++	B-Language
,	O
C#	B-Application
,	O
Cappuccino	O
,	O
Cocoa	B-Operating_System
,	O
Delphi	B-Language
,	O
Erlang	B-Operating_System
,	O
Go	B-Application
,	O
Haskell	B-Language
,	O
Java	B-Language
,	O
JavaScript	B-Language
,	O
Objective-C	B-Language
,	O
OCaml	B-Language
,	O
Perl	B-Language
,	O
PHP	B-Application
,	O
Python	B-Language
,	O
Ruby	B-Language
,	O
Elixir	B-Language
,	O
Rust	B-Application
,	O
Scala	B-Application
,	O
Smalltalk	B-Application
and	O
Swift	B-Application
.	O
</s>
<s>
The	O
implementation	O
was	O
described	O
in	O
an	O
April	O
2007	O
technical	O
paper	O
released	O
by	O
Facebook	B-Application
,	O
now	O
hosted	O
on	O
Apache	O
.	O
</s>
<s>
Thrift	B-Protocol
includes	O
a	O
complete	O
stack	O
for	O
creating	O
clients	O
and	O
servers	O
.	O
</s>
<s>
The	O
top	O
part	O
is	O
generated	O
code	O
from	O
the	O
Thrift	B-Protocol
definition	O
.	O
</s>
<s>
In	O
contrast	O
to	O
built-in	O
types	O
,	O
created	O
data	B-General_Concept
structures	I-General_Concept
are	O
sent	O
as	O
result	O
in	O
generated	O
code	O
.	O
</s>
<s>
The	O
protocol	O
and	O
transport	B-Architecture
layer	I-Architecture
are	O
part	O
of	O
the	O
runtime	B-Library
library	I-Library
.	O
</s>
<s>
With	O
Thrift	B-Protocol
,	O
it	O
is	O
possible	O
to	O
define	O
a	O
service	O
and	O
change	O
the	O
protocol	O
and	O
transport	O
without	O
recompiling	O
the	O
code	O
.	O
</s>
<s>
Besides	O
the	O
client	O
part	O
,	O
Thrift	B-Protocol
includes	O
server	O
infrastructure	O
to	O
tie	O
protocols	O
and	O
transports	O
together	O
,	O
like	O
blocking	O
,	O
non-blocking	O
,	O
and	O
multi-threaded	O
servers	O
.	O
</s>
<s>
Thrift	B-Protocol
supports	O
a	O
number	O
of	O
protocols	O
:	O
</s>
<s>
TBinaryProtocol	O
–	O
A	O
straightforward	O
binary	O
format	O
,	O
simple	O
,	O
but	O
not	O
optimized	O
for	O
space	B-General_Concept
efficiency	I-General_Concept
.	O
</s>
<s>
TJSONProtocol	O
–	O
Uses	O
JSON	B-General_Concept
for	O
encoding	O
of	O
data	O
.	O
</s>
<s>
TSimpleJSONProtocol	O
–	O
A	O
write-only	O
protocol	O
that	O
cannot	O
be	O
parsed	O
by	O
Thrift	B-Protocol
because	O
it	O
drops	O
metadata	O
using	O
JSON	B-General_Concept
.	O
</s>
<s>
TMemoryTransport	O
–	O
Uses	O
memory	B-Architecture
for	I-Architecture
I/O	I-Architecture
.	O
</s>
<s>
The	O
Java	B-Language
implementation	O
uses	O
a	O
simple	O
internally	O
.	O
</s>
<s>
TZlibTransport	O
–	O
Performs	O
compression	O
using	O
zlib	B-Language
.	O
</s>
<s>
TNonblockingServer	O
–	O
A	O
multi-threaded	O
server	O
using	O
non-blocking	B-Language
I/O	I-Language
(	O
Java	B-Language
implementation	O
uses	O
NIO	B-Language
channels	O
)	O
.	O
</s>
<s>
TSimpleServer	O
–	O
A	O
single-threaded	O
server	O
using	O
standard	O
blocking	B-Architecture
I/O	I-Architecture
.	O
</s>
<s>
TThreadedServer	O
–	O
A	O
multi-threaded	O
server	O
using	O
a	O
thread	O
per	O
connection	O
model	O
and	O
standard	O
blocking	B-Architecture
I/O	I-Architecture
.	O
</s>
<s>
TThreadPoolServer	O
–	O
A	O
multi-threaded	O
server	O
using	O
a	O
thread	O
pool	O
and	O
standard	O
blocking	B-Architecture
I/O	I-Architecture
.	O
</s>
<s>
Some	O
stated	O
benefits	O
of	O
Thrift	B-Protocol
include	O
:	O
</s>
<s>
Cross-language	O
serialization	B-Application
with	O
lower	O
overhead	O
than	O
alternatives	O
such	O
as	O
SOAP	B-Application
due	O
to	O
use	O
of	O
binary	O
format	O
.	O
</s>
<s>
No	O
XML	B-Protocol
configuration	O
files	O
.	O
</s>
<s>
The	O
language	B-Application
bindings	I-Application
feel	O
natural	O
.	O
</s>
<s>
For	O
example	O
,	O
Java	B-Language
uses	O
.	O
</s>
<s>
C++	B-Language
uses	O
std::vectorxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1	O
.	O
</s>
<s>
The	O
application-level	O
wire	O
format	O
and	O
the	O
serialization-level	O
wire	O
format	O
are	O
cleanly	O
separated	O
.	O
</s>
<s>
The	O
predefined	O
serialization	B-Application
styles	O
include	O
:	O
binary	O
,	O
HTTP-friendly	O
and	O
compact	O
binary	O
.	O
</s>
<s>
Doubles	O
as	O
cross-language	O
file	O
serialization	B-Application
.	O
</s>
<s>
Thrift	B-Protocol
does	O
not	O
require	O
a	O
centralized	O
and	O
explicit	O
mechanism	O
like	O
major-version/minor	O
-version	O
.	O
</s>
<s>
Thrift	B-Protocol
is	O
written	O
in	O
C++	B-Language
,	O
but	O
can	O
create	O
code	O
for	O
a	O
number	O
of	O
languages	O
.	O
</s>
<s>
To	O
create	O
a	O
Thrift	B-Protocol
service	O
,	O
one	O
has	O
to	O
write	O
Thrift	B-Protocol
files	O
that	O
describe	O
it	O
,	O
generate	O
the	O
code	O
in	O
the	O
destination	O
language	O
,	O
write	O
some	O
code	O
to	O
start	O
the	O
server	O
,	O
and	O
call	O
it	O
from	O
the	O
client	O
.	O
</s>
<s>
Thrift	B-Protocol
will	O
generate	O
the	O
code	O
out	O
of	O
this	O
descriptive	O
information	O
.	O
</s>
<s>
For	O
instance	O
,	O
in	O
Java	B-Language
,	O
the	O
PhoneType	O
will	O
be	O
a	O
simple	O
enum	B-Language
inside	O
the	O
Phone	O
class	O
.	O
</s>
