An Overview of Blockchains and How It is Connected to Big Data

Posted By : Dipen Chawla | 28-Oct-2017

 

What is a Blockchain?

The blockchain is a disseminated database framework that goes about as an "open record" to store and oversee exchanges. Each record in the database is known as a square and contains points of interest, for example, the exchange timestamp and in addition a connection to the past piece. This makes it outlandish for anybody to change data about the records reflectively. Additionally, because of the way that a similar exchange is recorded over numerous, appropriated database frameworks, the innovation is secure by the plan. On account of the above, blockchain is changeless – data stays in a similar state for whatever length of time that the system

Blockchain and Big Data

When you discuss blockchain with regards to Bitcoin, the association with Big Data appears somewhat questionable. Imagine a scenario in which, rather than Bitcoin, the blockchain was a record for other monetary exchanges. Or, on the other hand, business contracts? Or, on the other hand, stock exchanges?

The monetary administration's industry is beginning to investigate piece chain innovation. Oliver Bussmann, CIO of UBS says that blockchain innovation could "pare exchange preparing time from days to minutes."

The business basic in money related administrations for blockchain is effective. Envision blockchains of that size. Tremendous information pools of hinders that contain the full history of each monetary exchange, all accessible for investigation. Blockchain accommodates the honesty of the record, however not for the examination. That is the place Big Data and going with investigation instruments will become possibly the most important factor.

BlockChain Data Using Java:

 

import java.io.*;
import java.sql.*;
import java.util.*;
import java.lang.*;
  class BlockBigData
  {
     public  void blockSolve(String query)
     {
          
         try
         {
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("","system","");
         Statement st=con.createStatement();
         ResultSet rs=st.executeQuery(query);
         while(rs.next())
         {
             System.out.println(rs.getString(1)+"  "+"  "+rs.getString(2)+"\t");
         }
         rs.close();
         st.close();
         con.close();
       
          
       }
          
        catch(Exception e)
     {
         System.out.println(e);
     }
     finally{
     }
     }
  }
     class Application extends BlockBigData
     {
     public static void main(String args[])
     {  
     try{
        Scanner sc = new Scanner(System.in);
          BlockBigData obj= new BlockBigData();
         System.out.println("There are few numbers to execute query. To get result follow below given steps. ");
         System.out.println("Press 1. Top ten most viewed movies with their movies Name (Ascending or Descending order)");
         System.out.println("Press 2. Top twenty rated movies (Condition : The movie should be rated/viewed by at least 40 users) ");
         System.out.println(" PRESS 3.Top twenty rated movies (which is calculated in the previous step) with no of views in the following age group YOUNG");
         System.out.println(" PRESS 4.Top twenty rated movies (which is calculated in the previous step) with no of views in the following age group ADULT");
         System.out.println(" PRESS 5.Top twenty rated movies (which is calculated in the previous step) with no of views in the following age group OLD");
         System.out.println(" PRESS 6.  Top ten critics (Users who have given very low ratings; Condition : The users should have at least rated 40 movies) ");
         String query="";
         int k=sc.nextInt();
         switch(k)
         {
             case 1:
                   query="select title,movie_id from movies where MOVIE_ID in (select movie_id from (SELECT movie_id,count(user_id) from ratings group by MOVIE_ID order by count(user_id) desc) where rownum<=10) order by movie_id desc";
                    obj.blockSolve(query);
                     break;
            
            case 2:
                   query="select title,movie_id from movies where movie_id in (select movie_id from (SELECT movie_id,count(user_id) from ratings group by MOVIE_ID having count(user_id)>=40 )where rownum<=21)";
                    obj.blockSolve(query);
                     break;      
            case 3:
                  query="SELECT user_id,age from users where age<=20 and user_id in(select movie_id from (SELECT movie_id,count(user_id) from ratings group by MOVIE_ID having count(user_id)>=40 )where rownum<=21)";
                    obj.blockSolve(query);
                     break;
             case 4:
                  query="SELECT user_id,age from users where age>=40 and user_id in(select movie_id from (SELECT movie_id,count(user_id) from ratings group by MOVIE_ID having count(user_id)>=40 )where rownum<=21)";
                    obj.blockSolve(query);
                     break;
            case 5:
                   query="SELECT user_id,age from users where age BETWEEN 20 and 50 and user_id in(select movie_id from (SELECT movie_id,count(user_id) from ratings group by MOVIE_ID having count(user_id)>=40 )where rownum<=21)";
                    obj.blockSolve(query);
                     break;
              case 6:
                  query="select rating,movie_id,user_id from ratings where USER_ID in (select movie_id from (SELECT movie_id,count(user_id) from ratings group by MOVIE_ID having count(user_id)>=40 )where rownum<=21)order by rating";
                    obj.blockSolve(query);
                     break;
            
            default:
                    System.out.println("Invalid");            
        }  
     }
     catch(Exception e)
     {
         System.out.println(e);
     }
          
     }
 }

 

About Author

Author Image
Dipen Chawla

Dipen is Java Developer and his keen interest is in Spring, Hibernate, Rest web-services, AngularJS and he is a self motivated person and loves to work in a team.

Request for Proposal

Name is required

Comment is required

Sending message..