Giter Site home page Giter Site logo

sf-crime-rate-spark's Introduction

SF-Crime-Rate-Spark

In this project, Im working with a real-world dataset, extracted from Kaggle, on San Francisco crime incidents, and I will provide statistical analyses of the data using Apache Spark Structured Streaming. I create a Kafka server to produce data, and ingest data through Spark Structured Streaming.

Kafka-Console-Consumer: alt text

Spark UI: alt text

alt text

Spark Console: alt text

Progress Report: alt text

Q1 How did changing values on the SparkSession property parameters affect the throughput and latency of the data?

The throughput and latency of data can be controlled using the maxRatePerPartition, maxOffsetPerTrigger and the number of partitions.

Q2 What were the 2-3 most efficient SparkSession property key/value pairs? Through testing multiple variations on values, how can you tell these were the most optimal?

Changes in number of partitions has significant impact on the number of records being processed as multiple consumers can read simultaneously.

Case 1 - #Partitions = 1, maxRatePerPartition = 200, maxOffsetsPerTrigger = 200

Case 2 - #Partitions = 4, maxRatePerPartition = 50, maxOffsetsPerTrigger = 200 -> Higher throughput than case 1 due to increase in #partitions

Case 3 - #Partitions = 1, maxRatePerPartition = 200, maxOffsetsPerTrigger = 300 -> Lower throughput and higher latency than case 1 due to out of sync values of maxRatePerPartition and maxOffsetsPerTrigger

alt text

alt text

sf-crime-rate-spark's People

Contributors

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