SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
CLICKSTREAM ANALYSIS WITH
SPARK – UNDERSTANDING
VISITORS IN REAL-TIME
Dr. Josef Adersberger
QAware GmbH, Germany
THE CHALLENGE
One Kettle to Rule ‘em All
Web Tracking Ad Tracking
ERP CRM
One Kettle to Rule ‘em All
Retention Reach
Monetarization
steer …
 Campaigns
 Offers
 Contents
THE CONCEPTS
by Randy Paulino
The First Sketch
(= real-time)
Tableau
User Journey Analysis
C V VT VT VT C X
C V
V V V V V V V
C V V C V V V
VT VT V V V VT C
V X
Event stream: User journeys:
Web / Ad tracking
KPIs:
 Unique users
 Conversions
 Ad costs / conversion value
 …
V
X
VT
C Click
View
View Time
Conversion
THE ARCHITECTURE
„Larry & Friends“ Architecture
Collector Aggregation
SQL DB
Runs not well for more
than 1 TB data in terms of
ingestion speed, query time
and optimization efforts
by adweek.com
Nope.
Sorry, no Big Data.
„Hadoop & Friends“ Architecture
Collector
Batch Processor
[Hadoop]
Collector Event Data Lake Batch Processor Analytics DB
JSON
Stream
Aggregation
takes too long
Cumbersome
programming model
(can be solved with
pig, cascading et al.)
Not
interactive
enough
Nope.
Too sluggish.
κ-Architecture
Collector Stream Processor
Analytics DB
Persistence
JSON
Stream
Cumbersome
programming model
Over-engineered: We only need
15min real-time ;-)
Stateful aggregations (unique x,
conversions) require a separate DB
with high throughput and fast
aggregations & lookups.
λ-Architecture
Collector
Event Processor
Event Data Lake Batch Processor
Analytics DB
Speed Layer
Batch Layer
JSON
Stream
Cumbersome
programming model
Complex
architecture
Redundant
logic
Feels Over-Engineered…
http://www.brainlazy.com/article/random-nonsense/over-engineered
The Final Architecture*
*) Maybe called μ-architecture one day ;-)
Functional Architecture
Strange Events
IngestionRaw Event
Stream
Collection Events Processing Analytics
Warehouse
Fact
Entries
Atomic Event
Frames
Data Lake
Master Data Integration
 Buffers load peeks
 Ensures message
delivery (fire & forget
for client)
 Create user journeys and
unique user sets
 Enrich dimensions
 Aggregate events to KPIs
 Ability to replay for schema
evolution
 The representation of truth
 Multidimensional data
model
 Interactive queries for
actions in realtime and
data exploration
 Eternal memory for all
events (even strange
ones)
 One schema per event
type. Time partitioned.
class Analytics Model
«fact»
WebFact
«dimension»
Zeit
«dimension»
Kampagne
Jahr
Quartal
Monat
Woche
Tag
Stunde
Minute
Kunde
+ Land: String
Partner
«dimension»
Tracking
Tracking Group
SensorTag
+ Typ: SensorTagType
Platzierung
+ Format: ImageSize
+ Kostenmodell: KostenmodellArt
Werbemittel
+ AdGroup: String
+ Format: ImageSize
+ Größe: KiloBytes
+ LandingPage: URL
+ Motif: URL
Kampagne
«dimension»
Client
Kategorie
Dev ice
+ Bezeichner: String
+ Hersteller: String
+ Typ: String
Browser
+ Typ: String
+ Version: int
«dimension»
Ausspielort
LandRegion
Stadt
«dimension»
Kanal
Kanal
«dimension»
Vermarktung
«enumeration»
SensorTagType
ORDER_TAG
MASTER_TAG
CUSTOM_TAG
Betriebssystem
+ Typ: String
+ Version: Version
⦁ Dimension: Unabhängiges Prädikat auf Metriken bei der Analyse ("kann isoliert darüber nachdenken / isoliert dazu Analysen
fahren")
⦁ Hierarchie: Sub-Prädikat auf Metriken. Erzeugt mehr als eine (zueinander diskunkte) Teilmengen der Metriken. Entspricht den gängigen
Drill-Down-Pfaden in den Reports bzw. den Batch-Aggregate-Up-Pfaden in der Aggregationslogik. Semantische Unterstrukturen: "ist Teil
von & kann nicht existieren ohne".
⦁ Asssoziation: Nicht verwendet. Separates Stammdatenmodell.
⦁ Attribut: Ermöglicht eine weitere (querschneidende) Einschränkung der Metrikmenge ergänzend zu den Hierarchien.
Domain
Website
Tracking Site
Vermarkter
Auslieferungs-
Domain
Referral
«enumerati...
KostenmodellArt
CPC
CPM
CPO
CPA
«abstract»
DimensionValue
+ id: int
+ name: String
+ sourceId: String
WebsiteFact
+ Bounces: int
+ Verweildauer: float
+ Visits: int
BasicAdFact
+ Clicks: int
+ Sichtbare Views: int
+ Validierte Clicks: int
+ View (angefragt): int
+ View (ausgeliefert): int
+ View (gemessen): int
«dimension»
Produkt
Shop
Produkt
+ Produktkategorie: String
«dimension»
Zeitfenster
Letzte X Tage
«dimension»
User
User Segment
«dimension»
Order
OrderStatus
+ Status: OrderStatus
«enumeration»
OrderStatus
IN_BEARBEITUNG
ERFOLGREICH (AKTIVIERT)
ABGELEHNT
NICHT_IN_BEARBEITUNG
UniquesFact
+ Unique Clicks: int
+ Unique Users: int
+ Unique Views: int
AdCostFact
+ CPC: int
+ Kosten: float
Conv ersionFact
+ PC: int
+ PR: int
+ PV: int
+ Umsatz PC: float
+ Umsatz PR: float
+ Umsatz PV: float
AdVisibilityFact
+ Sichtbarkeitsdauer: float
Activ atedOrderFact
+ Orders: int
+ Umsatz: float
TrackingFact
+ Orders: int
+ Page Impressions: int
+ Umsatz: float
X = {7, 14, 28, 30}
 Fault tolerant message handling
 Event handling: Apply schema, time-partitioning, De-dup, sanity
checks, pre-aggregation, filtering, fraud detection
 Tolerates delayed events
 High throughput, moderate latency (~ 1min)
Series Connection of Streaming
and Batching - all based on Spark.
IngestionRaw Event
Stream
Collection Event Data Lake Processing Analytics
Warehouse
Fact
Entries
SQL Interface
Atomic Event
Frames
 Cool programming model
 Uniform dev&ops
 Simple solution
 High compression ratio due to
column-oriented storage
 High scan speed
 Cool programming model
 Uniform dev&ops
 High performance
 Interface to R out-of-the-box
 Useful libs: MLlib, GraphX, NLP, …
 Good connectivity (JDBC,
ODBC, …)
 Interactive queries
 Uniform ops
 Can easily be replaced
due to Hive Metastore
 Obvious choice for
cloud-scale messaging
 Way the best throughput
and scalability of all
evaluated alternatives
LESSONS LEARNED
by: http://hochmeister-alpin.at
Technology Mapping
https://github.com/qaware/big-data-landscape
User Interface
Data Lake
Data Warehouse
Ingestion
Processing
Data Science Interactive Analysis Reporting & Dashboards
Data Sources
Analytics
Micro Analytics Services instead of reporting
servers.
Charting Libraries:Dashboards:
Analytics Frontends
Algorithm Libraries
Structured Data Lake: The eternal memory.
Efficient data serialization formats:
 Integated compression
 Column-oriented storage
 Predicate pushdown
Distributed Filesystem or NoSQL DB
Data Workflows ETL Jobs Massive
Parallelization
Pig Open Studio
Data Logicstics Stream
Processing
NewSQL: SQL meets NoSQL.
Polyglott Persistence
Index Machines: Fast aggregation and search.
In-Memory Databases: Fast access.
Time Series Databases
Atlas
Polyglott Analytics
Data Lake
Analytics
Warehouse
SQL
lane
R
lane
Timeseries
lane
Reporting Data Exploration
Data Science
Micro Analytics Services
Microservice
Dashboard
Microservice …
No Retention Paranoia
Data Lake
Analytics
Warehouse
 Eternal memory
 Close to raw events
 Allows replays and refills
into warehouse
Aggressive forgetting with clearly defined
retention policy per aggregation level like:
 15min:30d
 1h:4m
 …
Events
Strange Events
Continuous Tuning
IngestionRaw Event
Stream
Collection Event Data Lake Processing Analytics
Warehouse
Fact
Entries
SQL Interface
Atomic Event
Frames
Load
Generator Throughput & latency probes
In Numbers
Overall dev effort until the first release: 250 person days
Dimensions: 10 KPIs: 26
Integrated 3rd party systems: 7
Inbound data volume per day: 80GB
New data in DWH per day: 2GB
Total price of cheapest cluster which is able to handle production load:
THANK YOU.
@adersberger
josef.adersberger@qaware.de
Bonus Topic: Roadmap
SparkKafka HDFS
IaaS
Simplify Ops with Mesos
Faster aggregation & easier updates
with Spark-on-Solr
http://qaware.blogspot.de/2015/06/solr-with-sparks-or-how-to-submit-spark.html
Bonus Topic: Smart Aggregation
Ingestion Event Data Lake Processing Analytics
Warehouse
Fact
Entries
Analytics
Atomic Event
Frames
1 2
3
Architecture follows requirements
class Analytics Model
«fact»
WebFact
«dimension»
Zeit
«dimension»
Kampagne
Jahr
Quartal
Monat
Woche
Tag
Stunde
Minute
Kunde
+ Land: String
Partner
«dimension»
Tracking
Tracking Group
SensorTag
+ Typ: SensorTagType
Platzierung
+ Format: ImageSize
+ Kostenmodell: KostenmodellArt
Werbemittel
+ AdGroup: String
+ Format: ImageSize
+ Größe: KiloBytes
+ LandingPage: URL
+ Motif: URL
Kampagne
«dimension»
Client
Kategorie
Device
+ Bezeichner: String
+ Hersteller: String
+ Typ: String
Browser
+ Typ: String
+ Version: int
«dimension»
Ausspielort
LandRegion
Stadt
«dimension»
Kanal
Kanal
«dimension»
Vermarktung
«enumeration»
SensorTagType
ORDER_TAG
MASTER_TAG
CUSTOM_TAG
Betriebssystem
+ Typ: String
+ Version: Version
⦁ Dimension: Unabhängiges Prädikat auf Metriken bei der Analyse ("kann isoliert darüber nachdenken / isoliert dazu Analysen
fahren")
⦁ Hierarchie: Sub-Prädikat auf Metriken. Erzeugt mehr als eine (zueinander diskunkte) Teilmengen der Metriken. Entspricht den gängigen
Drill-Down-Pfaden in den Reports bzw. den Batch-Aggregate-Up-Pfaden in der Aggregationslogik. Semantische Unterstrukturen: "ist Teil
von & kann nicht existieren ohne".
⦁ Asssoziation: Nicht verwendet. Separates Stammdatenmodell.
⦁ Attribut: Ermöglicht eine weitere (querschneidende) Einschränkung der Metrikmenge ergänzend zu den Hierarchien.
Domain
Website
Tracking Site
Vermarkter
Auslieferungs-
Domain
Referral
«enumerati...
KostenmodellArt
CPC
CPM
CPO
CPA
«abstract»
DimensionValue
+ id: int
+ name: String
+ sourceId: String
WebsiteFact
+ Bounces: int
+ Verweildauer: float
+ Visits: int
BasicAdFact
+ Clicks: int
+ Sichtbare Views: int
+ Validierte Clicks: int
+ View (angefragt): int
+ View (ausgeliefert): int
+ View (gemessen): int
«dimension»
Produkt
Shop
Produkt
+ Produktkategorie: String
«dimension»
Zeitfenster
Letzte X Tage
«dimension»
User
User Segment
«dimension»
Order
OrderStatus
+ Status: OrderStatus
«enumeration»
OrderStatus
IN_BEARBEITUNG
ERFOLGREICH (AKTIVIERT)
ABGELEHNT
NICHT_IN_BEARBEITUNG
UniquesFact
+ Unique Clicks: int
+ Unique Users: int
+ Unique Views: int
AdCostFact
+ CPC: int
+ Kosten: float
ConversionFact
+ PC: int
+ PR: int
+ PV: int
+ Umsatz PC: float
+ Umsatz PR: float
+ Umsatz PV: float
AdVisibilityFact
+ Sichtbarkeitsdauer: float
ActivatedOrderFact
+ Orders: int
+ Umsatz: float
TrackingFact
+ Orders: int
+ Page Impressions: int
+ Umsatz: float
X = {7, 14, 28, 30}
act Processing
Processing
WebsiteOrderActivationAdCostConversionUniques+
Overlap
AdVisibilityBasicAdsTracking
Dimensionsv erzeichnis
aktualisieren
Page
Impressions
und Orders
zählen
Aggregation
TrackingFact
Ad
Impressions
zählen
Aggregation
BasicAdFact
CTR und
Sichtbarkeitsrate
berechnen
Inferenz der
Sichtbarkeitsdauer
Aggregation
AdVisibilityFact
Dimensionsraum
aufspannen
Pro Vektor die Ev ents und
die dort enthaltenen UserIds
und Interaktionsarten
ermitteln
Menge der UserIds pro
Interaktionsart erzeugen und deren
Mächtigkeit bestimmen
UniquesFact
User Journeys
erstellen (bzw.
LV/LC pro User)
Attribution v on Conv ersion
auf Basis v orkonfiguriertem
Conv ersion Modell
Conv ersions
zählen (PV, PC, PR)
Warenkorbwert ermitteln
bei Order-Conv ersion
(PV, PC, PR)
Aggregation
Conv ersionFact
Kosten pro
Ev ent
ermitteln Aggregation
Nicht zuweisbare
Kosten ermitteln
CostFact
Inferenz der Visits
Visits zählen
Bounces zählen
Analyse der Verweildauer
Aggregation
WebsiteFact
Order Status
ermitteln
Anzahl der nicht getrackten Orders ermitteln
Aggregation
Activ atedOrderFact
:Analytics Warehouse:Event Data Lake
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
«flow»
Data Processing WorkflowMultidimensional Data Model
Sample results
Geolocated and gender-
specific conversions.
Frequency of visits
Performance of an ad campaign

Weitere ähnliche Inhalte

Was ist angesagt?

BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?
BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?
BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?Guido Schmutz
 
Hadoop in modernen BI-Infrastrukturen
Hadoop in modernen BI-InfrastrukturenHadoop in modernen BI-Infrastrukturen
Hadoop in modernen BI-Infrastruktureninovex GmbH
 
Hadoop Einführung @codecentric
Hadoop Einführung @codecentricHadoop Einführung @codecentric
Hadoop Einführung @codecentricimalik8088
 
Automotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache SolrAutomotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache SolrQAware GmbH
 
Webinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpaces
Webinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpacesWebinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpaces
Webinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpacesAWS Germany
 
MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2
MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2
MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2MongoDB
 
BARC Studie Webinar: Ausgereifte Analysen mit Apache Hadoop
BARC Studie Webinar: Ausgereifte Analysen mit Apache HadoopBARC Studie Webinar: Ausgereifte Analysen mit Apache Hadoop
BARC Studie Webinar: Ausgereifte Analysen mit Apache HadoopCloudera, Inc.
 
Hadoop 2.0 - The Next Level
Hadoop 2.0 - The Next LevelHadoop 2.0 - The Next Level
Hadoop 2.0 - The Next LevelSascha Dittmann
 
Eval Apache Storm vs. Spark Streaming - German
Eval Apache Storm vs. Spark Streaming - GermanEval Apache Storm vs. Spark Streaming - German
Eval Apache Storm vs. Spark Streaming - GermanErik Schmiegelow
 
Daten ohne Grenzen – Big Data
Daten ohne Grenzen – Big DataDaten ohne Grenzen – Big Data
Daten ohne Grenzen – Big DataAWS Germany
 
Big Data Bullshit Bingo
Big Data Bullshit BingoBig Data Bullshit Bingo
Big Data Bullshit BingoDanny Linden
 
Data Virtualization - Supernova
Data Virtualization - SupernovaData Virtualization - Supernova
Data Virtualization - SupernovaTorsten Glunde
 

Was ist angesagt? (14)

BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?
BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?
BPMN, BPEL oder vielleicht doch Java? Oder auch noch ESB?
 
Hadoop in modernen BI-Infrastrukturen
Hadoop in modernen BI-InfrastrukturenHadoop in modernen BI-Infrastrukturen
Hadoop in modernen BI-Infrastrukturen
 
Hadoop Einführung @codecentric
Hadoop Einführung @codecentricHadoop Einführung @codecentric
Hadoop Einführung @codecentric
 
Automotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache SolrAutomotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache Solr
 
Warum sap hana sql data warehousing
Warum sap hana sql data warehousingWarum sap hana sql data warehousing
Warum sap hana sql data warehousing
 
Webinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpaces
Webinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpacesWebinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpaces
Webinar Neues von der re:invent 2013 Teil 2: Kinesis, AppStream, WorkSpaces
 
MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2
MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2
MongoDB Atlas – der beste Weg, MongoDB in der Cloud zu betreiben 2
 
BARC Studie Webinar: Ausgereifte Analysen mit Apache Hadoop
BARC Studie Webinar: Ausgereifte Analysen mit Apache HadoopBARC Studie Webinar: Ausgereifte Analysen mit Apache Hadoop
BARC Studie Webinar: Ausgereifte Analysen mit Apache Hadoop
 
Hadoop 2.0 - The Next Level
Hadoop 2.0 - The Next LevelHadoop 2.0 - The Next Level
Hadoop 2.0 - The Next Level
 
Eval Apache Storm vs. Spark Streaming - German
Eval Apache Storm vs. Spark Streaming - GermanEval Apache Storm vs. Spark Streaming - German
Eval Apache Storm vs. Spark Streaming - German
 
Big Data: Kunden auf der Spur
Big Data: Kunden auf der SpurBig Data: Kunden auf der Spur
Big Data: Kunden auf der Spur
 
Daten ohne Grenzen – Big Data
Daten ohne Grenzen – Big DataDaten ohne Grenzen – Big Data
Daten ohne Grenzen – Big Data
 
Big Data Bullshit Bingo
Big Data Bullshit BingoBig Data Bullshit Bingo
Big Data Bullshit Bingo
 
Data Virtualization - Supernova
Data Virtualization - SupernovaData Virtualization - Supernova
Data Virtualization - Supernova
 

Ähnlich wie Clickstream Analysis with Spark

Big Data Webinar (Deutsch)
Big Data Webinar (Deutsch)Big Data Webinar (Deutsch)
Big Data Webinar (Deutsch)AWS Germany
 
Dataservices - Data Processing mit Microservices
Dataservices - Data Processing mit MicroservicesDataservices - Data Processing mit Microservices
Dataservices - Data Processing mit MicroservicesQAware GmbH
 
worldiety GmbH - Datenanalyse
worldiety GmbH - Datenanalyse worldiety GmbH - Datenanalyse
worldiety GmbH - Datenanalyse worldiety GmbH
 
Analytic powerhouse parallel data warehouse und r
Analytic powerhouse parallel data warehouse und rAnalytic powerhouse parallel data warehouse und r
Analytic powerhouse parallel data warehouse und rMarcel Franke
 
Folien2 spss watson roadshow_predictive
Folien2 spss watson roadshow_predictiveFolien2 spss watson roadshow_predictive
Folien2 spss watson roadshow_predictiveClara Ogwuazor Mbamalu
 
EventDB - Hamburg 2013
EventDB - Hamburg 2013EventDB - Hamburg 2013
EventDB - Hamburg 2013NETWAYS
 
Innovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzenInnovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzenAmazon Web Services
 
Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...
Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...
Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...inovex GmbH
 
Data Vault DWH Automation
Data Vault DWH AutomationData Vault DWH Automation
Data Vault DWH AutomationTorsten Glunde
 
Webcast: SAP on Azure für den Mittelstand - Erfolgsfaktor Integration
Webcast: SAP on Azure für den Mittelstand - Erfolgsfaktor IntegrationWebcast: SAP on Azure für den Mittelstand - Erfolgsfaktor Integration
Webcast: SAP on Azure für den Mittelstand - Erfolgsfaktor IntegrationQUIBIQ Hamburg
 
Eine Referenzarchitektur für das Digitale Produkt
Eine Referenzarchitektur für das Digitale ProduktEine Referenzarchitektur für das Digitale Produkt
Eine Referenzarchitektur für das Digitale ProduktIntelliact AG
 
Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...
Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...
Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...Dominik Horn
 
Technisches SEO 2019 Berlin SEO Campixx
Technisches SEO 2019 Berlin SEO CampixxTechnisches SEO 2019 Berlin SEO Campixx
Technisches SEO 2019 Berlin SEO CampixxAlona Demchyk (Hakel)
 
Data Is The New Oil
Data Is The New OilData Is The New Oil
Data Is The New OilParStream
 
Skalierung & Performance
Skalierung & PerformanceSkalierung & Performance
Skalierung & Performanceglembotzky
 
Automatisierung von Client-seitigen Web-Performance-Optimierungen
Automatisierung von Client-seitigen Web-Performance-OptimierungenAutomatisierung von Client-seitigen Web-Performance-Optimierungen
Automatisierung von Client-seitigen Web-Performance-OptimierungenJakob
 
Best practise 5 anwendungsfälle der google analytics api
Best practise 5 anwendungsfälle der google analytics apiBest practise 5 anwendungsfälle der google analytics api
Best practise 5 anwendungsfälle der google analytics apie-dialog GmbH
 

Ähnlich wie Clickstream Analysis with Spark (20)

Big Data Webinar (Deutsch)
Big Data Webinar (Deutsch)Big Data Webinar (Deutsch)
Big Data Webinar (Deutsch)
 
Dataservices - Data Processing mit Microservices
Dataservices - Data Processing mit MicroservicesDataservices - Data Processing mit Microservices
Dataservices - Data Processing mit Microservices
 
worldiety GmbH - Datenanalyse
worldiety GmbH - Datenanalyse worldiety GmbH - Datenanalyse
worldiety GmbH - Datenanalyse
 
JavaFX Real-World Apps
JavaFX Real-World AppsJavaFX Real-World Apps
JavaFX Real-World Apps
 
Analytic powerhouse parallel data warehouse und r
Analytic powerhouse parallel data warehouse und rAnalytic powerhouse parallel data warehouse und r
Analytic powerhouse parallel data warehouse und r
 
Folien2 spss watson roadshow_predictive
Folien2 spss watson roadshow_predictiveFolien2 spss watson roadshow_predictive
Folien2 spss watson roadshow_predictive
 
EventDB - Hamburg 2013
EventDB - Hamburg 2013EventDB - Hamburg 2013
EventDB - Hamburg 2013
 
Innovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzenInnovationen aus der Cloud ganz einfach nutzen
Innovationen aus der Cloud ganz einfach nutzen
 
Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...
Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...
Cloud Wars – what‘s the smartest data platform? Vergleich Microsoft Azure, Am...
 
Data Vault DWH Automation
Data Vault DWH AutomationData Vault DWH Automation
Data Vault DWH Automation
 
Webcast: SAP on Azure für den Mittelstand - Erfolgsfaktor Integration
Webcast: SAP on Azure für den Mittelstand - Erfolgsfaktor IntegrationWebcast: SAP on Azure für den Mittelstand - Erfolgsfaktor Integration
Webcast: SAP on Azure für den Mittelstand - Erfolgsfaktor Integration
 
Eine Referenzarchitektur für das Digitale Produkt
Eine Referenzarchitektur für das Digitale ProduktEine Referenzarchitektur für das Digitale Produkt
Eine Referenzarchitektur für das Digitale Produkt
 
Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...
Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...
Mit Prozessautomatisierung und Co-Creation zur Digitalisierung der Öffentlich...
 
Technisches SEO 2019 Berlin SEO Campixx
Technisches SEO 2019 Berlin SEO CampixxTechnisches SEO 2019 Berlin SEO Campixx
Technisches SEO 2019 Berlin SEO Campixx
 
Amazon Web Services
Amazon Web ServicesAmazon Web Services
Amazon Web Services
 
Data Is The New Oil
Data Is The New OilData Is The New Oil
Data Is The New Oil
 
Skalierung & Performance
Skalierung & PerformanceSkalierung & Performance
Skalierung & Performance
 
Automatisierung von Client-seitigen Web-Performance-Optimierungen
Automatisierung von Client-seitigen Web-Performance-OptimierungenAutomatisierung von Client-seitigen Web-Performance-Optimierungen
Automatisierung von Client-seitigen Web-Performance-Optimierungen
 
Best practise 5 anwendungsfälle der google analytics api
Best practise 5 anwendungsfälle der google analytics apiBest practise 5 anwendungsfälle der google analytics api
Best practise 5 anwendungsfälle der google analytics api
 
Apache Solr Revisited 2015
Apache Solr Revisited 2015Apache Solr Revisited 2015
Apache Solr Revisited 2015
 

Mehr von Josef Adersberger

Into the cloud, you better fly by sight
Into the cloud, you better fly by sightInto the cloud, you better fly by sight
Into the cloud, you better fly by sightJosef Adersberger
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-imageJosef Adersberger
 
The need for speed – transforming insurance into a cloud-native industry
The need for speed – transforming insurance into a cloud-native industryThe need for speed – transforming insurance into a cloud-native industry
The need for speed – transforming insurance into a cloud-native industryJosef Adersberger
 
The good, the bad, and the ugly of migrating hundreds of legacy applications ...
The good, the bad, and the ugly of migrating hundreds of legacy applications ...The good, the bad, and the ugly of migrating hundreds of legacy applications ...
The good, the bad, and the ugly of migrating hundreds of legacy applications ...Josef Adersberger
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesJosef Adersberger
 
Istio By Example (extended version)
Istio By Example (extended version)Istio By Example (extended version)
Istio By Example (extended version)Josef Adersberger
 
Docker und Kubernetes Patterns & Anti-Patterns
Docker und Kubernetes Patterns & Anti-PatternsDocker und Kubernetes Patterns & Anti-Patterns
Docker und Kubernetes Patterns & Anti-PatternsJosef Adersberger
 
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ... The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...Josef Adersberger
 
Dataservices - Processing Big Data The Microservice Way
Dataservices - Processing Big Data The Microservice WayDataservices - Processing Big Data The Microservice Way
Dataservices - Processing Big Data The Microservice WayJosef Adersberger
 
Cloud Native und Java EE: Freund oder Feind?
Cloud Native und Java EE: Freund oder Feind?Cloud Native und Java EE: Freund oder Feind?
Cloud Native und Java EE: Freund oder Feind?Josef Adersberger
 
Time Series Processing with Solr and Spark
Time Series Processing with Solr and SparkTime Series Processing with Solr and Spark
Time Series Processing with Solr and SparkJosef Adersberger
 
Time Series Processing with Apache Spark
Time Series Processing with Apache SparkTime Series Processing with Apache Spark
Time Series Processing with Apache SparkJosef Adersberger
 
Software-Sanierung: Wie man kranke Systeme wieder gesund macht.
Software-Sanierung: Wie man kranke Systeme wieder gesund macht.Software-Sanierung: Wie man kranke Systeme wieder gesund macht.
Software-Sanierung: Wie man kranke Systeme wieder gesund macht.Josef Adersberger
 

Mehr von Josef Adersberger (15)

Into the cloud, you better fly by sight
Into the cloud, you better fly by sightInto the cloud, you better fly by sight
Into the cloud, you better fly by sight
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-image
 
The need for speed – transforming insurance into a cloud-native industry
The need for speed – transforming insurance into a cloud-native industryThe need for speed – transforming insurance into a cloud-native industry
The need for speed – transforming insurance into a cloud-native industry
 
The good, the bad, and the ugly of migrating hundreds of legacy applications ...
The good, the bad, and the ugly of migrating hundreds of legacy applications ...The good, the bad, and the ugly of migrating hundreds of legacy applications ...
The good, the bad, and the ugly of migrating hundreds of legacy applications ...
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
 
Istio By Example (extended version)
Istio By Example (extended version)Istio By Example (extended version)
Istio By Example (extended version)
 
Docker und Kubernetes Patterns & Anti-Patterns
Docker und Kubernetes Patterns & Anti-PatternsDocker und Kubernetes Patterns & Anti-Patterns
Docker und Kubernetes Patterns & Anti-Patterns
 
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ... The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 
Dataservices - Processing Big Data The Microservice Way
Dataservices - Processing Big Data The Microservice WayDataservices - Processing Big Data The Microservice Way
Dataservices - Processing Big Data The Microservice Way
 
Cloud Native und Java EE: Freund oder Feind?
Cloud Native und Java EE: Freund oder Feind?Cloud Native und Java EE: Freund oder Feind?
Cloud Native und Java EE: Freund oder Feind?
 
Time Series Processing with Solr and Spark
Time Series Processing with Solr and SparkTime Series Processing with Solr and Spark
Time Series Processing with Solr and Spark
 
JEE on DC/OS
JEE on DC/OSJEE on DC/OS
JEE on DC/OS
 
Time Series Processing with Apache Spark
Time Series Processing with Apache SparkTime Series Processing with Apache Spark
Time Series Processing with Apache Spark
 
Big Data Landscape 2016
Big Data Landscape 2016Big Data Landscape 2016
Big Data Landscape 2016
 
Software-Sanierung: Wie man kranke Systeme wieder gesund macht.
Software-Sanierung: Wie man kranke Systeme wieder gesund macht.Software-Sanierung: Wie man kranke Systeme wieder gesund macht.
Software-Sanierung: Wie man kranke Systeme wieder gesund macht.
 

Clickstream Analysis with Spark

  • 1. CLICKSTREAM ANALYSIS WITH SPARK – UNDERSTANDING VISITORS IN REAL-TIME Dr. Josef Adersberger QAware GmbH, Germany
  • 3. One Kettle to Rule ‘em All Web Tracking Ad Tracking ERP CRM
  • 4. One Kettle to Rule ‘em All Retention Reach Monetarization steer …  Campaigns  Offers  Contents
  • 5.
  • 7. The First Sketch (= real-time) Tableau
  • 8. User Journey Analysis C V VT VT VT C X C V V V V V V V V C V V C V V V VT VT V V V VT C V X Event stream: User journeys: Web / Ad tracking KPIs:  Unique users  Conversions  Ad costs / conversion value  … V X VT C Click View View Time Conversion
  • 10. „Larry & Friends“ Architecture Collector Aggregation SQL DB Runs not well for more than 1 TB data in terms of ingestion speed, query time and optimization efforts
  • 12. „Hadoop & Friends“ Architecture Collector Batch Processor [Hadoop] Collector Event Data Lake Batch Processor Analytics DB JSON Stream Aggregation takes too long Cumbersome programming model (can be solved with pig, cascading et al.) Not interactive enough
  • 14. κ-Architecture Collector Stream Processor Analytics DB Persistence JSON Stream Cumbersome programming model Over-engineered: We only need 15min real-time ;-) Stateful aggregations (unique x, conversions) require a separate DB with high throughput and fast aggregations & lookups.
  • 15. λ-Architecture Collector Event Processor Event Data Lake Batch Processor Analytics DB Speed Layer Batch Layer JSON Stream Cumbersome programming model Complex architecture Redundant logic
  • 17. The Final Architecture* *) Maybe called μ-architecture one day ;-)
  • 18. Functional Architecture Strange Events IngestionRaw Event Stream Collection Events Processing Analytics Warehouse Fact Entries Atomic Event Frames Data Lake Master Data Integration  Buffers load peeks  Ensures message delivery (fire & forget for client)  Create user journeys and unique user sets  Enrich dimensions  Aggregate events to KPIs  Ability to replay for schema evolution  The representation of truth  Multidimensional data model  Interactive queries for actions in realtime and data exploration  Eternal memory for all events (even strange ones)  One schema per event type. Time partitioned. class Analytics Model «fact» WebFact «dimension» Zeit «dimension» Kampagne Jahr Quartal Monat Woche Tag Stunde Minute Kunde + Land: String Partner «dimension» Tracking Tracking Group SensorTag + Typ: SensorTagType Platzierung + Format: ImageSize + Kostenmodell: KostenmodellArt Werbemittel + AdGroup: String + Format: ImageSize + Größe: KiloBytes + LandingPage: URL + Motif: URL Kampagne «dimension» Client Kategorie Dev ice + Bezeichner: String + Hersteller: String + Typ: String Browser + Typ: String + Version: int «dimension» Ausspielort LandRegion Stadt «dimension» Kanal Kanal «dimension» Vermarktung «enumeration» SensorTagType ORDER_TAG MASTER_TAG CUSTOM_TAG Betriebssystem + Typ: String + Version: Version ⦁ Dimension: Unabhängiges Prädikat auf Metriken bei der Analyse ("kann isoliert darüber nachdenken / isoliert dazu Analysen fahren") ⦁ Hierarchie: Sub-Prädikat auf Metriken. Erzeugt mehr als eine (zueinander diskunkte) Teilmengen der Metriken. Entspricht den gängigen Drill-Down-Pfaden in den Reports bzw. den Batch-Aggregate-Up-Pfaden in der Aggregationslogik. Semantische Unterstrukturen: "ist Teil von & kann nicht existieren ohne". ⦁ Asssoziation: Nicht verwendet. Separates Stammdatenmodell. ⦁ Attribut: Ermöglicht eine weitere (querschneidende) Einschränkung der Metrikmenge ergänzend zu den Hierarchien. Domain Website Tracking Site Vermarkter Auslieferungs- Domain Referral «enumerati... KostenmodellArt CPC CPM CPO CPA «abstract» DimensionValue + id: int + name: String + sourceId: String WebsiteFact + Bounces: int + Verweildauer: float + Visits: int BasicAdFact + Clicks: int + Sichtbare Views: int + Validierte Clicks: int + View (angefragt): int + View (ausgeliefert): int + View (gemessen): int «dimension» Produkt Shop Produkt + Produktkategorie: String «dimension» Zeitfenster Letzte X Tage «dimension» User User Segment «dimension» Order OrderStatus + Status: OrderStatus «enumeration» OrderStatus IN_BEARBEITUNG ERFOLGREICH (AKTIVIERT) ABGELEHNT NICHT_IN_BEARBEITUNG UniquesFact + Unique Clicks: int + Unique Users: int + Unique Views: int AdCostFact + CPC: int + Kosten: float Conv ersionFact + PC: int + PR: int + PV: int + Umsatz PC: float + Umsatz PR: float + Umsatz PV: float AdVisibilityFact + Sichtbarkeitsdauer: float Activ atedOrderFact + Orders: int + Umsatz: float TrackingFact + Orders: int + Page Impressions: int + Umsatz: float X = {7, 14, 28, 30}  Fault tolerant message handling  Event handling: Apply schema, time-partitioning, De-dup, sanity checks, pre-aggregation, filtering, fraud detection  Tolerates delayed events  High throughput, moderate latency (~ 1min)
  • 19. Series Connection of Streaming and Batching - all based on Spark. IngestionRaw Event Stream Collection Event Data Lake Processing Analytics Warehouse Fact Entries SQL Interface Atomic Event Frames  Cool programming model  Uniform dev&ops  Simple solution  High compression ratio due to column-oriented storage  High scan speed  Cool programming model  Uniform dev&ops  High performance  Interface to R out-of-the-box  Useful libs: MLlib, GraphX, NLP, …  Good connectivity (JDBC, ODBC, …)  Interactive queries  Uniform ops  Can easily be replaced due to Hive Metastore  Obvious choice for cloud-scale messaging  Way the best throughput and scalability of all evaluated alternatives
  • 21. Technology Mapping https://github.com/qaware/big-data-landscape User Interface Data Lake Data Warehouse Ingestion Processing Data Science Interactive Analysis Reporting & Dashboards Data Sources Analytics Micro Analytics Services instead of reporting servers. Charting Libraries:Dashboards: Analytics Frontends Algorithm Libraries Structured Data Lake: The eternal memory. Efficient data serialization formats:  Integated compression  Column-oriented storage  Predicate pushdown Distributed Filesystem or NoSQL DB Data Workflows ETL Jobs Massive Parallelization Pig Open Studio Data Logicstics Stream Processing NewSQL: SQL meets NoSQL. Polyglott Persistence Index Machines: Fast aggregation and search. In-Memory Databases: Fast access. Time Series Databases Atlas
  • 24. No Retention Paranoia Data Lake Analytics Warehouse  Eternal memory  Close to raw events  Allows replays and refills into warehouse Aggressive forgetting with clearly defined retention policy per aggregation level like:  15min:30d  1h:4m  … Events Strange Events
  • 25. Continuous Tuning IngestionRaw Event Stream Collection Event Data Lake Processing Analytics Warehouse Fact Entries SQL Interface Atomic Event Frames Load Generator Throughput & latency probes
  • 26. In Numbers Overall dev effort until the first release: 250 person days Dimensions: 10 KPIs: 26 Integrated 3rd party systems: 7 Inbound data volume per day: 80GB New data in DWH per day: 2GB Total price of cheapest cluster which is able to handle production load:
  • 27.
  • 29. Bonus Topic: Roadmap SparkKafka HDFS IaaS Simplify Ops with Mesos Faster aggregation & easier updates with Spark-on-Solr http://qaware.blogspot.de/2015/06/solr-with-sparks-or-how-to-submit-spark.html
  • 30. Bonus Topic: Smart Aggregation Ingestion Event Data Lake Processing Analytics Warehouse Fact Entries Analytics Atomic Event Frames 1 2 3
  • 31. Architecture follows requirements class Analytics Model «fact» WebFact «dimension» Zeit «dimension» Kampagne Jahr Quartal Monat Woche Tag Stunde Minute Kunde + Land: String Partner «dimension» Tracking Tracking Group SensorTag + Typ: SensorTagType Platzierung + Format: ImageSize + Kostenmodell: KostenmodellArt Werbemittel + AdGroup: String + Format: ImageSize + Größe: KiloBytes + LandingPage: URL + Motif: URL Kampagne «dimension» Client Kategorie Device + Bezeichner: String + Hersteller: String + Typ: String Browser + Typ: String + Version: int «dimension» Ausspielort LandRegion Stadt «dimension» Kanal Kanal «dimension» Vermarktung «enumeration» SensorTagType ORDER_TAG MASTER_TAG CUSTOM_TAG Betriebssystem + Typ: String + Version: Version ⦁ Dimension: Unabhängiges Prädikat auf Metriken bei der Analyse ("kann isoliert darüber nachdenken / isoliert dazu Analysen fahren") ⦁ Hierarchie: Sub-Prädikat auf Metriken. Erzeugt mehr als eine (zueinander diskunkte) Teilmengen der Metriken. Entspricht den gängigen Drill-Down-Pfaden in den Reports bzw. den Batch-Aggregate-Up-Pfaden in der Aggregationslogik. Semantische Unterstrukturen: "ist Teil von & kann nicht existieren ohne". ⦁ Asssoziation: Nicht verwendet. Separates Stammdatenmodell. ⦁ Attribut: Ermöglicht eine weitere (querschneidende) Einschränkung der Metrikmenge ergänzend zu den Hierarchien. Domain Website Tracking Site Vermarkter Auslieferungs- Domain Referral «enumerati... KostenmodellArt CPC CPM CPO CPA «abstract» DimensionValue + id: int + name: String + sourceId: String WebsiteFact + Bounces: int + Verweildauer: float + Visits: int BasicAdFact + Clicks: int + Sichtbare Views: int + Validierte Clicks: int + View (angefragt): int + View (ausgeliefert): int + View (gemessen): int «dimension» Produkt Shop Produkt + Produktkategorie: String «dimension» Zeitfenster Letzte X Tage «dimension» User User Segment «dimension» Order OrderStatus + Status: OrderStatus «enumeration» OrderStatus IN_BEARBEITUNG ERFOLGREICH (AKTIVIERT) ABGELEHNT NICHT_IN_BEARBEITUNG UniquesFact + Unique Clicks: int + Unique Users: int + Unique Views: int AdCostFact + CPC: int + Kosten: float ConversionFact + PC: int + PR: int + PV: int + Umsatz PC: float + Umsatz PR: float + Umsatz PV: float AdVisibilityFact + Sichtbarkeitsdauer: float ActivatedOrderFact + Orders: int + Umsatz: float TrackingFact + Orders: int + Page Impressions: int + Umsatz: float X = {7, 14, 28, 30} act Processing Processing WebsiteOrderActivationAdCostConversionUniques+ Overlap AdVisibilityBasicAdsTracking Dimensionsv erzeichnis aktualisieren Page Impressions und Orders zählen Aggregation TrackingFact Ad Impressions zählen Aggregation BasicAdFact CTR und Sichtbarkeitsrate berechnen Inferenz der Sichtbarkeitsdauer Aggregation AdVisibilityFact Dimensionsraum aufspannen Pro Vektor die Ev ents und die dort enthaltenen UserIds und Interaktionsarten ermitteln Menge der UserIds pro Interaktionsart erzeugen und deren Mächtigkeit bestimmen UniquesFact User Journeys erstellen (bzw. LV/LC pro User) Attribution v on Conv ersion auf Basis v orkonfiguriertem Conv ersion Modell Conv ersions zählen (PV, PC, PR) Warenkorbwert ermitteln bei Order-Conv ersion (PV, PC, PR) Aggregation Conv ersionFact Kosten pro Ev ent ermitteln Aggregation Nicht zuweisbare Kosten ermitteln CostFact Inferenz der Visits Visits zählen Bounces zählen Analyse der Verweildauer Aggregation WebsiteFact Order Status ermitteln Anzahl der nicht getrackten Orders ermitteln Aggregation Activ atedOrderFact :Analytics Warehouse:Event Data Lake «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» «flow» Data Processing WorkflowMultidimensional Data Model
  • 32. Sample results Geolocated and gender- specific conversions. Frequency of visits Performance of an ad campaign