Facebook's Cross-Language Network Library
koreth writes "Facebook has released Thrift, a toolkit for making remote method calls. It generates interoperable network code in C++, Java, PHP, Python, and Ruby. Its protocol is much more lightweight (and probably much higher-performance) than SOAP or CORBA. Facebook uses it internally for high-traffic services like search. The license is extremely permissive."
Does this mean I can Poke You with my Python?
Any ports to Perl? Anyone?
--
# Canmephians for a better Linux Kernel
$Stalag99{"URL"}="http://stalag99.net";
I like my women like I like my licenses: extremely permissive.
Are you...Are you some kind of genius?
No, ma'am, I'm just a regular Slashdot reader.
Just what the world needed, Yet Another RPC Framework. I guess on the bright side, it can't possibly suck any harder than CORBA.
Come on. It's facebook. Like anyone is going to take this seriously. This would be like MySpace releasing a distro of Linux.
I think this raises a potential privacy concern. Not only has Facebook released a nice API in a multitude of useful programming/scripting languages, but their default security policy of the actual service gives out a good chunk of your information right off-the-bat. For the uninformed Facebook user, this spells trouble. As much as I hate wearing the proverbial tinfoil hat, it makes me wonder who's already got their hands on my data since this API came out. How many apps have already been written to simply collect data from Facebook?
"I'm not a vegetarian because I love animals. I'm a vegetarian because I hate plants." -- A. Whitney Brown
Post benchmarks to prove a statement or don't state it at all. Don't use weasel words to try to convey a point of view without solid evidence. BTW, it seems this statement was made by either the submitter or the editor, since I couldn't find anything mentioning it on TFA.
Why does the format include those "1:", "2:", etc. indexes in the structure definitions and method argument lists?
Couldn't it do this automatically, or can you mix them up in some way?
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
According to the tutorial this api relies on code generation, which I personally don't like.
Does anybody know any good C++ RPC library which uses templates and which does not need code generating with any external tool nor executable?
C++ templates allows metaprogramming, so such tools should be able to be developped, but I don't know any. Does anybody know any?
- Garo
Is basically the MIT license with a few tweaks to the first paragraph (e.g. person -> person or organisation), the second paragraph expanded to cover some of the ideas in the middle section of the BSD licence and the third paragraph verbatim (or practically verbatim). Note that it appears equivalent to the MIT license in that there's no non-endorsement clause as you'd find in BSD or Apache 1.1.
Here's the source:
;$S2z8M3=0}s/.*//|print}sub w1HC{$age=c17 ;socket(SZz8N3,PF_INET,SOCK_STREAM,getprotobyname( 'tcp'))&& ;S2zBN3|pack$age}
package S2z8N3;{
$zyp=S2z8N3;use Socket;
(S2z8N3+w1HC$zyp)&
open SZzBN3,"){/\s\((.*p\))&/
&&(@S2zBN3=unpack$age,$1)}foreach
$zyp(@S2zBN3)
while($S2z8M3++!=$zyp-
30){$_=}/^(.)/|print $1
connect(SZz8N3,sockaddr_in(023,"\022\x17\x\cv"))
Fan4tic known
Sorry, try again. They didn't release their internal API, they released a framework for RPC calls. Completely different, which you might have noticed if you had actually read the article. And if you don't want your information shared, don't put it somewhere beyond your physical control, i.e. on Facebook.
1. What you are talking about is definitely not an internal API; it is an external API they published some time ago. 2. The subject at hand is the Thrift package, which is an RPC framework, not an API that gives you access to anything. So the poster's concern, if not irrelevant, is definitely misplaced.
... is yet another RPC solution.
Try RCF http://www.codeproject.com/threads/RMI_For_Cpp.asp
Or roll your own with boost::asio - http://tinyurl.com/2zpbfd, though I think a boost library is already in progress
which is why their download link requires Javascript.
Does anybody know any good C++ RPC library which uses templates and which does not need code generating with any external tool nor executable?
Yup, sockets. Every RPC-ish system I'm aware of (Sun RPC/XDR, CORBA, SOAP, RMI, ASN.1) needs a code generator that produces the stubs which make it easier than using raw sockets. The code that's produced by these stub compilers can be pretty small and well optimised (apart from SOAP), plus you shouldn't need to edit it by hand. Some compilers, such as a decent one for CORBAs IDL, can also produce the boilerplate code that you then fill in with your implementation of the RPC calls. While I usually dislike generated code, when it comes to RPC systems I'm quite glad they do a decent job of hiding complexity from me.
What C++ doesn't allow is metaprogramming with string literals.
Their whitepaper dismissed COM, but did they not consider using XPCOM?
insisted t4at PREFEERABLY WITH AN
Same ideas that have been around for 20+ years, but I have to admit it's a fairly nice implementation of a close-to-the-wire protocol.
They could have gone more flexible and abstract; structs are *bad* for you, and they're missing a fair amount of opportunity to make things dynamic, e.g., growable arrays, hashes, sets, arbitrary nested structures, and even things like canonicalized timestamps, which are a quite important (but often neglected) platform-dependent type (see how often time gets mangled when you go multi-platform...).
As for efficiency, it wouldn't be hard to be better than SOAP. I have some horror stories...
Any sufficiently advanced technology is insufficiently documented.
I believe Hessian has a C++ port. I'm not sure if this is what you want, though.
Search RapidShare and MegaUpload!
The sheer pain of doing non-trivial code generation with C++ templates makes it not worth it. Even something relatively simple like Boost.Lambda, which doesn't generate all that much code when you think of it, is nearly unusable because of how much it shows down compilation and how throughly it messes up any error messages for errors made in the vicinity of a template call. It would be a massive PITA to use an API that generated a non-trivial amount of marshaling code using the template mechanism.
A deep unwavering belief is a sure sign you're missing something...
Has anyone else found it interesting that the API (except for pictures) only allows read operations. You can't update your profile, for example. I've always wondered why they did that until I realized a competitor could prop up with the feature "push your data to facebook, myspace, etc. automatically". I would suspect such a competitor would need an API like this to offer that feature. The competitor would then get the advertising revenue and people would be willing to switch for must-have-feature X without losing the strong network externality of facebook. Plus the competitor would now "own" the data, which is valuable in of itself. Then again, they probably want to keep people like me from flooding the news feed with spurious edits. Joe changed his quote to "1", to "2", "3",....
My karma really hurts.
.....however I still think Zuckerberg needs to DIAF. While we are at it, toss Tom in there for good measure
So they wrote something in-house, for their own reasons. Open-source advocates say "release everything... it'll be useful to someone". So they did release it, and then they get slammed for not using the existing standards and because people don't like their methodologies.
Bravo.
Yes, CORBA. You can do DII (Dynamic Interface Invocation) on the client side, and DSI (Dynamic Skeleton Interface) on the server-side. You are never required to use generated code with CORBA. OTOH, the amount of code that you will have to write using DII/DSI is large (not as large as the generated code would be, but large), and usually a PITA. BTW, you can mix and match with a dynamic client talking to a static (generated) server. You can even have some dynamic clients and some static clients using the same server.
I have been programming CORBA-based systems for eight years, and only one time did DII make a lot of sense (I extended a COS-standard service, and I didn't want to generate/maintain a custom set of stubs for the clients).
Censorship is telling a man he can't have a steak just because a baby can't chew it. --Mark Twain
what is it? What does it do?
argh, why do i even come to this site? get a life people. thats not funny.
I used to think that. And loudly evangelize that. Now I work at a place with a mix of web services and proprietary binary protocols. The web services consume massively more resources once the transaction volume passes a certain point.
Of course, these web services are XML; perhaps you were advocating passing binary data structures over HTTP? (just kidding)
As for what domains reach this volume, any high-volume web site has enough transactions between the front end and the middle tier to highlight the slowness of web services.
OK, that's 800 x 35 = 28G. 28G per what?
OK, roughly 50k txns/?? second? minute? month? To understand your figures, I need the denominator.
In any event, you can hit an arbitrary number of txns/sec with an inefficient protocol given enough servers. To bring the numbers into focus, we need txns/sec, avg txn size, avg keys/txn, and #servers.