Coder Social home page Coder Social logo

customer-viewership-realtime-analysis's Introduction

Realtime-Customer-Viewership-Analysis

In this project, i have created data pipeline using the lambda architecture (Batch and screaming flow). Project cleanup and optimization in progress.

I have acquired following types of data from different sources:

1.Customer Profile Data: This a dimension data of SCD1 type stored in Oracle DB. Type of data is structured. Dynamic lookup is performed on this data every minute and cached in memory.

2.Weblog Events of Customers: This data is loaded by some other system into the linux landing pad. It is a growing, historical data of CSV type. This data is loaded once in a day.

3.HTTP Status Codes: This is a static data of XML type which is loaded only once.

4.Customer Web Events: This data represents what customers doing right now. It is a json data which is pulled from web service via NIFI and pushed to Kafka topic which is then consumed every 10 sec.

Current Code Flow (will Optimize later):

  1. Imported necessary libraries in POM.xml and imported in project.
  2. Initialized spark Session, spark Context and logger level.
  3. Loaded the static XML data and converted to Data Frame using databricks library.
  4. Created StructType Schema for weblog data.
  5. Loaded the weblog csv file as rdd using sc.textFile and converted to row rdd and then created dataframe using createDataFrame method to enforce null type validation.
  6. Method is created to load customer profile data from DB using spark jdbc option.
  7. Created a new ConstantInputDStream which always returns the same mandatory input RDD at every batch time. This is used to pull data from RDMS in a streaming fashion. In this stream we are doing the dynamic lookup by calling method to load data from DB every one minute and caching the result in memory.
  8. Performed joining of all the 3 dataframes in a final DF to aggregate the results and store it in ElasticSearch index.
  9. Visualization is created in Kibana from the ES index.
  10. Final DF is streamed to output Kafka Topic.

Functionality Achieved:

  • Unification
  • Federation
  • Lambda
  • SCD-1

alt text

customer-viewership-realtime-analysis's People

Contributors

lovenui avatar lovenuna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.