Facebook Opensourced Presto

Facebook opensourced its data processing technique ‘Presto’ to the world. Presto is a distributed query engine based on ANSI SQL. It is very optimized and currently running with more than 300 petabytes of data, which may one among the top big data processing systems. Presto is a totally different from mapreduce. It is an in memory data processing mechanism and is very much optimised. From the details given in the facebook newsletter and presto website, it is 10 times faster than Hive. mapreduce.Hive came from facebook only, so presto will definitely beat hive. Hive queries are ultimately running as multiple mapreduce jobs and it will take more time. From my point of view, the competition may be between Cloudera Impala and Presto. Impala’s performance with huge datasets is not available now from any production environments because it is a budding technology from cloudera family, but presto is already tested and running in huge dataset production environment. Another interesting fact about presto is that we can use the already existing infrastructure and hadoop cluster for deploying presto, because presto supports hdfs as its underlying data storage. It supports other storage systems also. So it is flexible. Leading internet companies including Airbnb and Dropbox are using Presto. Presto code and further details are available in this link

I have deployed Presto and Impala on a small cluster of 8 nodes. I haven’t got enough time to explore more on presto. I am planning to explore more on the coming days. ūüôā


Accessing Facebook using Java Program.

Here is a simple java application for accessing facebook. This is done by using restfb, which is a  simple and flexible Facebook Graph API and Old REST API client written in Java.

For this we need an access token which we can generate using graph API explorer in facebook developers website.

Download the restfb jar.

Get an access token with necessary permissions.

package com.amal.fb;

import com.restfb.DefaultFacebookClient;
import com.restfb.FacebookClient;
import com.restfb.Parameter;
import com.restfb.types.FacebookType;
import com.restfb.types.User;

public class FacebookAppnew {
public static void main(String[] args) {
 System.setProperty("https.proxyHost", "PROXY");
 System.setProperty("https.proxyPort", "PORT");
 FacebookClient fbClient = new DefaultFacebookClient("MY_ACCESS_TOKEN");
 User user = fbClient.fetchObject("me", User.class);
 // Getting the Details from FB
 System.out.println("UserName :"+user.getName());
 System.out.println("Birthday :"+user.getBirthday());
 System.out.println("Bio :"+user.getBio());
 System.out.println("Email :"+user.getEmail());

 //Making a post in Facebook
 FacebookType publishMessageResponse =
 fbClient.publish("me/feed", FacebookType.class,
 Parameter.with("message", "Good Evening"));


Similarly we can post photos, videos etc.