You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by vikas prasad <vi...@gmail.com> on 2014/02/02 11:13:09 UTC

Re: Visual Studio with C++ client Thrift

Hi,

I am c++ developer using COM for IPC all through out these days.. currently
trying to write sample app with thrift..
What are the basic differences between COM and Thrift?
What are the performance benefits of using thrift vs. COM:
1- Impact on binary size
2- Initialization time
3- Impact to boot time


Thanks,
Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile Mobile
- +91 9 6633 7 6688

Skype - vikasmca05

Also available on *Tango*,*Viber* and *WhatsApp*
website :www.vikasgomia.blogspot.com




On Mon, Jan 27, 2014 at 11:48 PM, Jake Farrell <jf...@apache.org> wrote:

> The install guide is available at:
> http://thrift.apache.org/docs/install/windows/
>
> and there is also the windows README in the source:
> compiler/cpp/README_Windows.txt
>
> -Jake
>
>
> On Mon, Jan 27, 2014 at 1:05 PM, Jens Geyer <je...@hotmail.com> wrote:
>
> > Vikas,
> >
> > the single best recommendation is to have a look at the tutorials. If you
> > have specific questions or need help, you are free to ask here or at
> > freenode at any time.
> >
> > Have fun!
> > JensG
> > ________________________________
> > Von: vikas prasad
> > Gesendet: 27.01.2014 15:03
> > An: user@thrift.apache.org
> > Betreff: Visual Studio with C++ client Thrift
> >
> > Hi,
> >
> > I am new  to Thrift framework
> > I went through few of the online tutorials to develop c++ thrift client
> > using c++/
> > can someone please list down the steps to develop c++ thrift client?
> >
> > Thanks,
> > Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile
> > Mobile
> > - +91 9 6633 7 6688
> >
> > Skype - vikasmca05
> >
> > Also available on *Tango*,*Viber* and *WhatsApp*
> > website :www.vikasgomia.blogspot.com
> >
>

Re: Visual Studio with C++ client Thrift

Posted by vikas prasad <vi...@gmail.com>.
Hi Randy,

Hope you are doing good !!
Thanks for detailed answer. I will definitely try out with COM & Thrift App
simultaneously and compare.


Thanks,
Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile Mobile
- +91 9 6633 7 6688

Skype - vikasmca05

Also available on *Tango*,*Viber* and *WhatsApp*
website :www.vikasgomia.blogspot.com




On Sun, Feb 2, 2014 at 8:59 PM, Randy Abernethy
<ra...@gmail.com>wrote:

> Hi Vikas,
>
> Some thoughts:
>
> >>  What are the basic differences between COM and Thrift?
>
> As you know, DCOM (Distributed COM circa 1997) is an object oriented RPC
> system which essentially implements COM over MSRPC (a flavor of DCE RPC,
> circa 1994). In DCOM remote objects are (at least conceptually) created and
> maintained through reference counting and garbage collected when no further
> interface handles are held to them. Interface discovery is supported (via
> IUnknown).
> Remote objects can be stateful and (in COM+) pooled and reused or included
> in distributed transaction using MTS. All in all this is a heavy weight,
> feature
> rich, and some would say, complex platform.
>
> Apache Thrift (circa 2007) is a lightweight cross language remote procedure
> call
> platform. There are no middle ware components necessary and clients
> interact
> directly with servers. Thrift offers no built in discovery, security, state
> or
> transaction support.
>
> Like DCOM, Apache Thrift supplies an IDL to describe interfaces. IMHO,
> Thrift
> IDL has two key features not present in DCOM IDL:
>
> 1. Interfaces can evolve without hard coded versions and without breaking
> compatibility
> 2. Collections like set/list/map are first class citizens
>
> Thrift has a single compiler which will emit code for many languages from
> this
> IDL (unlike midl which is C/C++ oriented). With Thrift you generate the
> client/server
> stubs and you are ready to go. With DCOM you need to do a fair amount of
> work
> to wire things up, particularly when using non core MS languages/platforms.
> The
> DCOM middleware layer is required for DCOM to operate in most settings.
>
> Both platforms need to marshal (serialize) types to a wire format. Thrift
> however
> offers a plug in platform allowing Binary, Compact, JSON and custom
> serialization
> engines to be used and interchanged easily.
>
> COM provides an extensive embedding framework, Thrift supplies no such
> feature
> but does include a plug in transport platform that makes it easy to
> serialize Thrift
> types to Memory, Disk or Network interfaces. Using this facility the core
> Thrift
> library supports many transports, including TCP/IP sockets and named pipes
> for example.
>
> It is also fair to note that while innovative in its day DCOM is not
> receiving a lot
> of attention in modern development efforts (MS or otherwise). Thrift runs
> on Windows,
> OSX, all flavors of Linux, most all *nix, iOS/Android and embedded systems.
> Thrift
> supports Java, C++, Python, C#, Go, Delphi, Node.js, JavaScript, Php, Ruby
> and many other languages natively.
>
> All in all, DCOM is a technology focused on the Client/Server computing era
> of
> the 90s bent on competing with CORBA. Thrift is a technology built for the
> SOA/Cloud era.
>
> >>  What are the performance benefits of using thrift vs. COM:
> >>  1- Impact on binary size
>
> The Thrift footprint varies by language but I think it is safe to say the
> net effect
> will be binaries much smaller than those built for DCOM. Particularly if
> you include
> all of the DLLs and middle ware involved in a communications session.
>
> >>  2- Initialization time
>
> DCOM connections are expensive to setup, one reason why all of the pooling
> techniques are used. Most Thrift connections boil down to a TCP connection.
> That said if you are gaining benefits from COM+ object pooling and DB
> connection
> pooling on the server you will have to build those yourself or find them in
> other layers
> with Thrift. So in the end what you are "initializing" will define the
> answer here. On
> an apples to apples basis however a Thrift client will make a simple
> connection to
> a Thrift server much faster than DCOM will in my experience.
>
> >>  3- Impact to boot time
>
> There are no platform registration aspects of Thrift. When you start a
> server it
> loads and typically begins listening to a TCP/IP port. Clients just make a
> TCP
> connection and then are ready to run. Here again because Thrift does not
> provide
> all of the middle ware features present in DCOM there is really no startup
> overhead.
>
> The only way to really answer all three of these questions accurately is to
> build a
> client and server in Thrift with your language on your platform and then
> again with
> DCOM.
>
> I built a large Windows DNA system with DCOM in the late 90s. It was a
> great
> platform for the times. However, I think the CAP theorem, massive scaling
> needs
> and modern deployment sensibilities make platforms like DCOM too
> restrictive
> for many modern application architectures.
>
> Just my 2 cents, hope this helps,
> Randy
>
>
>
> On Sun, Feb 2, 2014 at 2:13 AM, vikas prasad <vi...@gmail.com> wrote:
>
> > Hi,
> >
> > I am c++ developer using COM for IPC all through out these days..
> currently
> > trying to write sample app with thrift..
> > What are the basic differences between COM and Thrift?
> > What are the performance benefits of using thrift vs. COM:
> > 1- Impact on binary size
> > 2- Initialization time
> > 3- Impact to boot time
> >
> >
> > Thanks,
> > Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile
> > Mobile
> > - +91 9 6633 7 6688
> >
> > Skype - vikasmca05
> >
> > Also available on *Tango*,*Viber* and *WhatsApp*
> > website :www.vikasgomia.blogspot.com
> >
> >
> >
> >
> > On Mon, Jan 27, 2014 at 11:48 PM, Jake Farrell <jf...@apache.org>
> > wrote:
> >
> > > The install guide is available at:
> > > http://thrift.apache.org/docs/install/windows/
> > >
> > > and there is also the windows README in the source:
> > > compiler/cpp/README_Windows.txt
> > >
> > > -Jake
> > >
> > >
> > > On Mon, Jan 27, 2014 at 1:05 PM, Jens Geyer <je...@hotmail.com>
> > wrote:
> > >
> > > > Vikas,
> > > >
> > > > the single best recommendation is to have a look at the tutorials. If
> > you
> > > > have specific questions or need help, you are free to ask here or at
> > > > freenode at any time.
> > > >
> > > > Have fun!
> > > > JensG
> > > > ________________________________
> > > > Von: vikas prasad
> > > > Gesendet: 27.01.2014 15:03
> > > > An: user@thrift.apache.org
> > > > Betreff: Visual Studio with C++ client Thrift
> > > >
> > > > Hi,
> > > >
> > > > I am new  to Thrift framework
> > > > I went through few of the online tutorials to develop c++ thrift
> client
> > > > using c++/
> > > > can someone please list down the steps to develop c++ thrift client?
> > > >
> > > > Thanks,
> > > > Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. |
> > Mobile
> > > > Mobile
> > > > - +91 9 6633 7 6688
> > > >
> > > > Skype - vikasmca05
> > > >
> > > > Also available on *Tango*,*Viber* and *WhatsApp*
> > > > website :www.vikasgomia.blogspot.com
> > > >
> > >
> >
>

Re: Visual Studio with C++ client Thrift

Posted by Randy Abernethy <ra...@gmail.com>.
Hi Vikas,

Some thoughts:

>>  What are the basic differences between COM and Thrift?

As you know, DCOM (Distributed COM circa 1997) is an object oriented RPC
system which essentially implements COM over MSRPC (a flavor of DCE RPC,
circa 1994). In DCOM remote objects are (at least conceptually) created and
maintained through reference counting and garbage collected when no further
interface handles are held to them. Interface discovery is supported (via
IUnknown).
Remote objects can be stateful and (in COM+) pooled and reused or included
in distributed transaction using MTS. All in all this is a heavy weight,
feature
rich, and some would say, complex platform.

Apache Thrift (circa 2007) is a lightweight cross language remote procedure
call
platform. There are no middle ware components necessary and clients
interact
directly with servers. Thrift offers no built in discovery, security, state
or
transaction support.

Like DCOM, Apache Thrift supplies an IDL to describe interfaces. IMHO,
Thrift
IDL has two key features not present in DCOM IDL:

1. Interfaces can evolve without hard coded versions and without breaking
compatibility
2. Collections like set/list/map are first class citizens

Thrift has a single compiler which will emit code for many languages from
this
IDL (unlike midl which is C/C++ oriented). With Thrift you generate the
client/server
stubs and you are ready to go. With DCOM you need to do a fair amount of
work
to wire things up, particularly when using non core MS languages/platforms.
The
DCOM middleware layer is required for DCOM to operate in most settings.

Both platforms need to marshal (serialize) types to a wire format. Thrift
however
offers a plug in platform allowing Binary, Compact, JSON and custom
serialization
engines to be used and interchanged easily.

COM provides an extensive embedding framework, Thrift supplies no such
feature
but does include a plug in transport platform that makes it easy to
serialize Thrift
types to Memory, Disk or Network interfaces. Using this facility the core
Thrift
library supports many transports, including TCP/IP sockets and named pipes
for example.

It is also fair to note that while innovative in its day DCOM is not
receiving a lot
of attention in modern development efforts (MS or otherwise). Thrift runs
on Windows,
OSX, all flavors of Linux, most all *nix, iOS/Android and embedded systems.
Thrift
supports Java, C++, Python, C#, Go, Delphi, Node.js, JavaScript, Php, Ruby
and many other languages natively.

All in all, DCOM is a technology focused on the Client/Server computing era
of
the 90s bent on competing with CORBA. Thrift is a technology built for the
SOA/Cloud era.

>>  What are the performance benefits of using thrift vs. COM:
>>  1- Impact on binary size

The Thrift footprint varies by language but I think it is safe to say the
net effect
will be binaries much smaller than those built for DCOM. Particularly if
you include
all of the DLLs and middle ware involved in a communications session.

>>  2- Initialization time

DCOM connections are expensive to setup, one reason why all of the pooling
techniques are used. Most Thrift connections boil down to a TCP connection.
That said if you are gaining benefits from COM+ object pooling and DB
connection
pooling on the server you will have to build those yourself or find them in
other layers
with Thrift. So in the end what you are "initializing" will define the
answer here. On
an apples to apples basis however a Thrift client will make a simple
connection to
a Thrift server much faster than DCOM will in my experience.

>>  3- Impact to boot time

There are no platform registration aspects of Thrift. When you start a
server it
loads and typically begins listening to a TCP/IP port. Clients just make a
TCP
connection and then are ready to run. Here again because Thrift does not
provide
all of the middle ware features present in DCOM there is really no startup
overhead.

The only way to really answer all three of these questions accurately is to
build a
client and server in Thrift with your language on your platform and then
again with
DCOM.

I built a large Windows DNA system with DCOM in the late 90s. It was a
great
platform for the times. However, I think the CAP theorem, massive scaling
needs
and modern deployment sensibilities make platforms like DCOM too
restrictive
for many modern application architectures.

Just my 2 cents, hope this helps,
Randy



On Sun, Feb 2, 2014 at 2:13 AM, vikas prasad <vi...@gmail.com> wrote:

> Hi,
>
> I am c++ developer using COM for IPC all through out these days.. currently
> trying to write sample app with thrift..
> What are the basic differences between COM and Thrift?
> What are the performance benefits of using thrift vs. COM:
> 1- Impact on binary size
> 2- Initialization time
> 3- Impact to boot time
>
>
> Thanks,
> Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile
> Mobile
> - +91 9 6633 7 6688
>
> Skype - vikasmca05
>
> Also available on *Tango*,*Viber* and *WhatsApp*
> website :www.vikasgomia.blogspot.com
>
>
>
>
> On Mon, Jan 27, 2014 at 11:48 PM, Jake Farrell <jf...@apache.org>
> wrote:
>
> > The install guide is available at:
> > http://thrift.apache.org/docs/install/windows/
> >
> > and there is also the windows README in the source:
> > compiler/cpp/README_Windows.txt
> >
> > -Jake
> >
> >
> > On Mon, Jan 27, 2014 at 1:05 PM, Jens Geyer <je...@hotmail.com>
> wrote:
> >
> > > Vikas,
> > >
> > > the single best recommendation is to have a look at the tutorials. If
> you
> > > have specific questions or need help, you are free to ask here or at
> > > freenode at any time.
> > >
> > > Have fun!
> > > JensG
> > > ________________________________
> > > Von: vikas prasad
> > > Gesendet: 27.01.2014 15:03
> > > An: user@thrift.apache.org
> > > Betreff: Visual Studio with C++ client Thrift
> > >
> > > Hi,
> > >
> > > I am new  to Thrift framework
> > > I went through few of the online tutorials to develop c++ thrift client
> > > using c++/
> > > can someone please list down the steps to develop c++ thrift client?
> > >
> > > Thanks,
> > > Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. |
> Mobile
> > > Mobile
> > > - +91 9 6633 7 6688
> > >
> > > Skype - vikasmca05
> > >
> > > Also available on *Tango*,*Viber* and *WhatsApp*
> > > website :www.vikasgomia.blogspot.com
> > >
> >
>

Re: Visual Studio with C++ client Thrift

Posted by vikas prasad <vi...@gmail.com>.
Great !! Thanks for so detailed answer ... Thanks a tonne !!

Thanks,
Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile Mobile
- +91 9 6633 7 6688

Skype - vikasmca05

Also available on *Tango*,*Viber* and *WhatsApp*
website :www.vikasgomia.blogspot.com




On Sun, Feb 2, 2014 at 8:51 PM, Jens Geyer <je...@hotmail.com> wrote:

> Hi Vikas,
>
>
>  trying to write sample app with thrift..
>>
>
> Great! Please have a look at our tutorials and the TestServer/TestClient
> implementations of the various languages, this helps you getting started
> quickly.
>
>
>  What are the basic differences between COM and Thrift?
>>
>
> Thrift is lightweight and cross-platform by design. COM is mainly (only?)
> used in the Microsoft world, similar to CORBA the initial design goals
> focused more on objects (the "O" in both names) rather than general RPC. In
> contrast, Thrift is designed to be lightweight and flexible from the
> beginning, and the focus lies on connecting languages and platforms with as
> less overhead as possible, both vis-á-vis development and runtime
> performance.
>
> Next, with Thrift you do have much more influence on the actual
> transports/protocols used (e.g. Sockets, HTTP, Pipes, etc), this is
> something COM hides from you very good, especially with cross-machine
> calls. As part of the MS ecosystem, COM is well-integrated into Windows'
> security concepts - this is not the case with Thrift, and you have to
> develop a suitable concept for your service(s) public APIs on your own.
> Similar to COM you get a marshalling layer, composed from generated code
> and the Thrift library, so you don't have to spend much time with this
> besides designing the interface in an easy to learn IDL.
>
>
>  What are the performance benefits of using thrift vs. COM:
>> 1- Impact on binary size
>>
>
> Good question, but less important, honestly. Most the COM infrastructure
> is shipped with Windows, and I never felt the need to compared the size of
> my binaries. But I can tell, that we just recently trew out a COM interface
> we used to connect the .NET part and the Win32 part of an application of
> ours, and replaced that interface by a Thrift-based solution, and it was a
> full success. If we were faced again with the same decision, we would do it
> in a heartbeat.
>
>  2- Initialization time
>>
>
> Depends on what transport you use. In general, the time needed to
> initialize the serevr or client transports properly and maybe start the
> threadpool (if used). Did I mention that Thrift is very lightweight?
>
>
>  3- Impact to boot time
>>
>
> It's all static code, or static or dynamic libraries linked to your
> application, so it does not affect OS boot time. If you mean "load time" of
> the application binaries, the impact is less than you probably think.
>
> Have fun,
> JensG
>
> -----Ursprüngliche Nachricht----- From: vikas prasad
> Sent: Sunday, February 2, 2014 11:13 AM
> To: user@thrift.apache.org ; jfarrell@apache.org
> Subject: Re: Visual Studio with C++ client Thrift
>
> Hi,
>
> I am c++ developer using COM for IPC all through out these days.. currently
> trying to write sample app with thrift..
> What are the basic differences between COM and Thrift?
> What are the performance benefits of using thrift vs. COM:
> 1- Impact on binary size
> 2- Initialization time
> 3- Impact to boot time
>
>
> Thanks,
> Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile
> Mobile
> - +91 9 6633 7 6688
>
> Skype - vikasmca05
>
> Also available on *Tango*,*Viber* and *WhatsApp*
> website :www.vikasgomia.blogspot.com
>
>
>
>
> On Mon, Jan 27, 2014 at 11:48 PM, Jake Farrell <jf...@apache.org>
> wrote:
>
>  The install guide is available at:
>> http://thrift.apache.org/docs/install/windows/
>>
>> and there is also the windows README in the source:
>> compiler/cpp/README_Windows.txt
>>
>> -Jake
>>
>>
>> On Mon, Jan 27, 2014 at 1:05 PM, Jens Geyer <je...@hotmail.com>
>> wrote:
>>
>> > Vikas,
>> >
>> > the single best recommendation is to have a look at the tutorials. If >
>> you
>> > have specific questions or need help, you are free to ask here or at
>> > freenode at any time.
>> >
>> > Have fun!
>> > JensG
>> > ________________________________
>> > Von: vikas prasad
>> > Gesendet: 27.01.2014 15:03
>> > An: user@thrift.apache.org
>> > Betreff: Visual Studio with C++ client Thrift
>> >
>> > Hi,
>> >
>> > I am new  to Thrift framework
>> > I went through few of the online tutorials to develop c++ thrift client
>> > using c++/
>> > can someone please list down the steps to develop c++ thrift client?
>> >
>> > Thanks,
>> > Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile
>> > Mobile
>> > - +91 9 6633 7 6688
>> >
>> > Skype - vikasmca05
>> >
>> > Also available on *Tango*,*Viber* and *WhatsApp*
>> > website :www.vikasgomia.blogspot.com
>> >
>>
>>
>

Re: Visual Studio with C++ client Thrift

Posted by Jens Geyer <je...@hotmail.com>.
Hi Vikas,

> trying to write sample app with thrift..

Great! Please have a look at our tutorials and the TestServer/TestClient 
implementations of the various languages, this helps you getting started 
quickly.

> What are the basic differences between COM and Thrift?

Thrift is lightweight and cross-platform by design. COM is mainly (only?) 
used in the Microsoft world, similar to CORBA the initial design goals 
focused more on objects (the "O" in both names) rather than general RPC. In 
contrast, Thrift is designed to be lightweight and flexible from the 
beginning, and the focus lies on connecting languages and platforms with as 
less overhead as possible, both vis-á-vis development and runtime 
performance.

Next, with Thrift you do have much more influence on the actual 
transports/protocols used (e.g. Sockets, HTTP, Pipes, etc), this is 
something COM hides from you very good, especially with cross-machine calls. 
As part of the MS ecosystem, COM is well-integrated into Windows' security 
concepts - this is not the case with Thrift, and you have to develop a 
suitable concept for your service(s) public APIs on your own. Similar to COM 
you get a marshalling layer, composed from generated code and the Thrift 
library, so you don't have to spend much time with this besides designing 
the interface in an easy to learn IDL.

> What are the performance benefits of using thrift vs. COM:
> 1- Impact on binary size

Good question, but less important, honestly. Most the COM infrastructure is 
shipped with Windows, and I never felt the need to compared the size of my 
binaries. But I can tell, that we just recently trew out a COM interface we 
used to connect the .NET part and the Win32 part of an application of ours, 
and replaced that interface by a Thrift-based solution, and it was a full 
success. If we were faced again with the same decision, we would do it in a 
heartbeat.

> 2- Initialization time

Depends on what transport you use. In general, the time needed to initialize 
the serevr or client transports properly and maybe start the threadpool (if 
used). Did I mention that Thrift is very lightweight?

> 3- Impact to boot time

It's all static code, or static or dynamic libraries linked to your 
application, so it does not affect OS boot time. If you mean "load time" of 
the application binaries, the impact is less than you probably think.

Have fun,
JensG

-----Ursprüngliche Nachricht----- 
From: vikas prasad
Sent: Sunday, February 2, 2014 11:13 AM
To: user@thrift.apache.org ; jfarrell@apache.org
Subject: Re: Visual Studio with C++ client Thrift

Hi,

I am c++ developer using COM for IPC all through out these days.. currently
trying to write sample app with thrift..
What are the basic differences between COM and Thrift?
What are the performance benefits of using thrift vs. COM:
1- Impact on binary size
2- Initialization time
3- Impact to boot time


Thanks,
Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile 
Mobile
- +91 9 6633 7 6688

Skype - vikasmca05

Also available on *Tango*,*Viber* and *WhatsApp*
website :www.vikasgomia.blogspot.com




On Mon, Jan 27, 2014 at 11:48 PM, Jake Farrell <jf...@apache.org> wrote:

> The install guide is available at:
> http://thrift.apache.org/docs/install/windows/
>
> and there is also the windows README in the source:
> compiler/cpp/README_Windows.txt
>
> -Jake
>
>
> On Mon, Jan 27, 2014 at 1:05 PM, Jens Geyer <je...@hotmail.com> wrote:
>
> > Vikas,
> >
> > the single best recommendation is to have a look at the tutorials. If 
> > you
> > have specific questions or need help, you are free to ask here or at
> > freenode at any time.
> >
> > Have fun!
> > JensG
> > ________________________________
> > Von: vikas prasad
> > Gesendet: 27.01.2014 15:03
> > An: user@thrift.apache.org
> > Betreff: Visual Studio with C++ client Thrift
> >
> > Hi,
> >
> > I am new  to Thrift framework
> > I went through few of the online tutorials to develop c++ thrift client
> > using c++/
> > can someone please list down the steps to develop c++ thrift client?
> >
> > Thanks,
> > Vikas| Software Dev Engineer| McAfee Software (India) Pvt. Ltd. | Mobile
> > Mobile
> > - +91 9 6633 7 6688
> >
> > Skype - vikasmca05
> >
> > Also available on *Tango*,*Viber* and *WhatsApp*
> > website :www.vikasgomia.blogspot.com
> >
>