Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Facebook's Cross-Language Network Library 104

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."
This discussion has been archived. No new comments can be posted.

Facebook's Cross-Language Network Library

Comments Filter:
  • Re:Ohhh, goody (Score:1, Informative)

    by Gr8Apes ( 679165 ) on Tuesday April 03, 2007 @08:23AM (#18585959)
    I wish I could say "Who still uses CORBA?", unfortunately, the answer would include me. :( Give me Sun's RMI implementation any day of the week, or even C++ married to JMS. CORBA gives black holes a run for the money.
  • by Anonymous Coward on Tuesday April 03, 2007 @08:46AM (#18586187)

    I think this raises a potential privacy concern. Not only has Facebook released a nice API in a multitude of useful programming/scripting languages,
    Dude, this *isn't* an API to Facebook's database. It's a stand-alone remote procedure call mechanism (think SOAP or CORBA - you know, like they said in the summary) that happens to be developed by and used by Facebook.

  • The license (Score:5, Informative)

    by Anonymous Conrad ( 600139 ) on Tuesday April 03, 2007 @08:53AM (#18586273)
    Is basically the MIT license [opensource.org] 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 [opensource.org] 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 [opensource.org].
  • by Kyle_Katarn-(ISF) ( 982133 ) on Tuesday April 03, 2007 @09:09AM (#18586429)
    He's not saying THIS is an API, but that they have released one. Which is true; I've dabbled with it a bit myself.
  • by NickCatal ( 865805 ) on Tuesday April 03, 2007 @09:15AM (#18586475)
    I can't agree more! And the creator of Facebook has said multiple times that they are not going to allow custom CSS on profiles or crazy stuff like that. They have also gone a long way with privacy settings (after much outrage in the facebook community)

    As a college student, I love Facebook. I use it to keep up with high school friends, keep in contact with people from the school I transfered from, know the people in my classes so I can throw questions at them if I have one, and since I am bad with names it is a great tool to remember people by!

    The information I have on Facebook you could probably [wikipedia.org] find [nickcatalano.com] elsewhere [google.com]. But having such a clean interface is great. and their improvements are going to be great [facebook.com] (membership required)
  • Re:Ohhh, goody (Score:3, Informative)

    by Cthefuture ( 665326 ) on Tuesday April 03, 2007 @09:48AM (#18586915)
    No kidding.

    XML is a standard for heavyweight text type communication.

    ASN.1 BER encoding is a standard for lightweight binary communication (similar to this Thrift crap except ASN.1 is an ISO standard and used everywhere).

    Any RPC method worth its salt would use one of those.
  • by Anonymous Coward on Tuesday April 03, 2007 @10:12AM (#18587275)
    Try RCF http://www.codeproject.com/threads/RMI_For_Cpp.asp [codeproject.com]

    Or roll your own with boost::asio - http://tinyurl.com/2zpbfd [tinyurl.com], though I think a boost library is already in progress
  • Re:Ohhh, goody (Score:4, Informative)

    by LizardKing ( 5245 ) on Tuesday April 03, 2007 @10:51AM (#18587921)

    I've worked with CORBA at my last three jobs, and I've been pretty happy with it. I've used OmniORB, Orbacus, JacORB and MICO - all of which work very well, although the licensing cost of Orbacus puts it out of reach for most of the things I work on. I do have to wrap a lot of the C++ stuff in helper classes though, as the mapping for that language is far too baroque. One of the consultants at IONA has produced an open source CORBA utilities library [ciaranmchale.com] that which is far more extensive than my one.

  • by yabos ( 719499 ) on Tuesday April 03, 2007 @10:57AM (#18588035)
    That's funny you say that since Facebook's users are not mostly teenage morons.
    http://www.comscore.com/press/release.asp?press=10 19 [comscore.com]
    Hmm, seems 12-17 year olds only make up 14% of Facebook users.
  • by indifferent children ( 842621 ) on Tuesday April 03, 2007 @01:04PM (#18590041)
    Does anybody know any good C++ RPC library which uses templates and which does not need code generating with any external tool nor executable?

    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).

  • by FueledByRamen ( 581784 ) <sabretooth@gmail.com> on Tuesday April 03, 2007 @04:24PM (#18593611)

    growable arrays
    On the transport layer? That doesn't make any sense. The endpoint implementations insert into language-standard growable arrays (PHP native indexed arrays, C++ std::vector, et al), as they should.

    hashes
    Easily represented as maps.

    sets
    They have those. Templated type 'set' in the Thrift interface file (just like std::set).

    arbitrary nested structures
    And those. map<string, map<string, set<string> > > is a perfectly valid construct in the Thrift file, and will emit (as you might expect) the same thing using STL data structures in the C++ endpoint, or nested assocative arrays in the PHP endpoint. The same thing applies to non-templated structure nesting as well, and to templating around user defined structures.

    canonicalized timestamps
    There's no good reason to make a separate timestamp class; an int64 is plenty big enough to hold microseconds (or nanoseconds, even) since the epoch.
  • by UltraAyla ( 828879 ) on Tuesday April 03, 2007 @10:27PM (#18598609) Homepage
    Their API requires that a user authorize a site to collect their information. If, after a warning for each site, a user still authorizes it, then that's their own problem

All the simple programs have been written.

Working...