thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Bennett" <da...@yorkage.com>
Subject RE: How best to add data types esp DateTime and Decimal
Date Thu, 10 Sep 2015 02:46:32 GMT
Thrift does a great job in supporting both common primitive types and common structured types.
But the lack of unsigned support for C/C++, and the lack of decimal and date/time for business
apps, will always tend to result in clunky substitutes.

I've already seen i64 used as a timestamp, but without agreement on the scale and epoch the
client user is going to have to do something clunky with it.

I'm new here and I'm sure there is lots of history I don't know about. I do know that Thrift
has some compelling advantages, but without better support for widely used primitives there
are opportunities that will be missed.

FWIW my view is that if Thrift chose 'good enough' wire formats for these types and offered
'good enough but leaky' support for them in various languages, there would be net benefit
that would outweigh the various limitations incurred.

Regards
David M Bennett FACS

Andl - A New Database Language - andl.org


-----Original Message-----
From: Jens Geyer [mailto:jensgeyer@hotmail.com] 
Sent: Thursday, 10 September 2015 6:23 AM
To: user@thrift.apache.org
Subject: Re: How best to add data types esp DateTime and Decimal

Hi,

> With that said, I highly recommend that you DON'T expose your Thrift 
> API directly to users. Thrift is a GREAT framework for generating rpc 
> code in many languages, but it has to support the lowest common 
> denominator of languages features so that means it feels clunky and 
> unnatural in most languages.

Sorry, I can't agree with that - at least not as it is written. The lowest common denominator
is right, but that's a very technical restriction too a good portion.


> In the early days, Cassandra exposed their Thrift API directly to 
> users and it didn't work out well.

If the API is shitty by design, it will not help much to shoot the messenger. No, I don't
say that the Cassandra Thrift API is badly designed. 
What I want to point out  by this is this: The quality of any API is made in the design step.

Whether you expose the result of the API contract design via Thrift or by some other means
does not really matter that much in my experience (except if you try to do RPC with REST,
but that's a whole other story). Especially with Thrift the generated API interface feels
very natural, at least that's my personal impression.

Re DateTime: We had that discussion before. There is no built-in data type for this. Main
reason is that there are too many date/time formats around. I don't remember the whole discussion
but I'm sure it is in the mailing list archives.

Have fun,
JensG


Mime
View raw message