SlideShare a Scribd company logo
1 of 85
Download to read offline
“Real-time big data v tvojej samoške”
Milan Novota
Head of Product
m.novota@pygmalios.com
Prieskum
Kto z vás nakupuje v kamenných
obchodoch?
Ráta sa aj bufet.
Prieskum
Kto z vás tam nakupuje rád?
Fakt
Fyzické nakupovanie
je naša každodenná realita,
ktorá častokrát bolí.
Kvíz
Akú časť celosvetových tržieb v
maloobchode podľa vás tvoria nákupy cez
internet?
Fakt
Fyzické nakupovanie v mnohých ohľadoch
vážne zaostáva
za e-nakupovaním
Problém č.1
Problém č.2
Naša misia
Fixnúť tieto problémy.
Naše riešenie
Senzory a software.
Pygmalios Engineering
Rado Buranský
Scala developer
r.buransky@pygmalios.com
Kamery RTLS Mobily
Obchod
Dátový tok v reálnom čase
1.Z predajne chodia 10tky JSON správ za sekundu
2.Na 2 týždne sa uložia do Kafky
3.Spark Streaming číta z Kafky
4.Dáta v pôvodnom tvare ukladá do Cassandry
5.Zagregované do Influxu
6.Node.js číta z Influxu cez HTTP API
Zdroje dát
WiFi na mobiloch
Real-time location system - presná poloha
Kamery (nie video) - počítanie ľudí, pohlavie, vek
POS transakcie
Služby tretích strán (počasie, atď.)
Chceme byť nezávislí od konkrétneho HW
Kamery RTLS Mobily
Obchod
Distribuovaná implementácia kruhového buffera
uloženého na magnetický disk
Úžasne veľká priepustnosť
Spoľahlivosť
Kamery RTLS Mobily
Obchod
Prekrásny funkcionálny objektový jazyk pre JVM
Silné statické typovanie
Immutability by default
Bohatá štandardná knižnica
Oveľa menej kódu ako v Jave
Sada nástrojov na paralelné a distribuované appky
Futures, Actors
Clustering / remoting
Let it crash!
"Without Resilience, Nothing Else Matters" - Jonas Bonér
Batchové aj streamové spracovanie dát
Ďalšia generácia po Hadoop MapReduce
Bohaté API - Scala, Python, R, Java
Strojové učenie
Interaktívny režim
Veľa spôsobov nasadenia
Kamery RTLS Mobily
Obchod
Distribuovaná databáza
Vysoká dostupnosť
Lineárna škálovateľnosť
Rýchly zápis
Dátový model ideálny pre immutable časové dáta
Denormalizácia je štandard
Kamery RTLS Mobily
Obchod
Databáza pre časové údaje
Bohaté API
Jednoduchá integrácia s grafovými nástrojmi
Priekopnícky spolupracujeme s autormi
Spravili sme vlastný reaktívny driver
Kamery RTLS Mobily
Obchod
Čítanie dát z Influxu cez HTTP API
Uživateľské rozhranie
Infraštruktúra
Architektúra
Lambda architektúra
Immutable master dataset
Donekonečna pribúdajúce dáta, zdroj všetkej pravdy
Každá query je fcia na všetkými dátami
Batch vrstva
Pre každú query pregeneruje view z master datasetu
Speed vrstva
Kompenzuje pomalosť batchu
ale môže vniesť nekonzistentnosť
Vďaka Sparku sú algoritmy
pre batch aj speed vrstvu
naimplementované iba raz
Príklad:
Konverzia nakupujúcich
Priemerná konverzia nakupujúcich
Počet odchádzajúcich ľudí / počet tých čo nakúpili
Zdroje dát:
1. info o pohybe ľudí z kamier
2. POS transakcie z pokladní
Transformácie
Agregácia do 15-minútových okien
Cassandra counter dátový typ
Join
problém
Join nie je ľahký
Spojenie dvoch prúdov dát do jedného
Čo ak niektoré správy prídu o hodinu (deň) neskôr?
Čo ak niektoré prídu viac razy?
Čo ak sa popredbiehajú?
Cassandra ho nepodporuje
Garancia doručenia správ
Garancia doručenia správ
Najviac raz
správy sa strácajú
Aspoň raz
nič sa nestráca ale môže prísť viackrát
Práve raz
nedá sa - viď. Byzantínci
Naozaj sa "práve raz" nedá?
Nevadí, sú spôsoby ako sa s tým vysporiadať:
idempotencia
transakcie
Výsledok je ako keby bola každá správa doručená práve raz
Centrálny monitoring a logging
Škálovanie
Škálovanie
Pribúdajú predajne
Naša výhoda je predvídateľnosť
Treba kapacitu vôbec plánovať?
Škálovanie vďaka Akke
Actorom je im jedno, či sú na tej istej mašine
Akka Cluster zabezpečuje odolnú decentralizáciu
NodeGuardian
AvgConvRateActor PeopleCountActorPosTransactionActor SepApiActor
Hierarchia Akka actorov
Škálovanie vďaka Sparku
Master / worker architektúra
Flexibilné pridávanie worker nodov
Škálovanie vďaka Cassandre
Partitioning
Lineárna charakteristika
Škálovanie vďaka Amazon Web Services
EC2 inštancie
s predpripravenými imagemi
DataStax Enterprise
Okamžité spustenie
AWS
m3.xlarge
Cassandra
Spark
Akka
Škálovanie vďaka Dockeru
Horizontálne škálovanie vytvorením
nových kontajnerov inštancií aplikácie
Predikcia je náš cieľ
Historické dáta sú nuda
Treba predpovedať budúcnosť
Priamo povedať prevádzkarovi čo robiť
Nech odpoveď nehľadá v grafoch a reportoch
"O týždeň v stredu príde 17 žien v strednom veku a nakúpia Alpu.
Doobjednaj ďalšie na sklad."
Spark Machine Learning library
Klasifikácia, regresia, clustering, ...
Prediktívna analýza pre existujúce metriky
SW riešenie namiesto HW:
okoloidúci vs. návštevníci z intenzity WIFI signálu
Technológie nás bavia
Chceme byť tech
Beta verzie cutting-edge technológii
Prispievanie do open sourcu
Verejné zdieľanie skúseností
Budovanie lokálnej komunity
Teraz môžem v práci robiť to,
čo som kedysi robil iba po nociach
Povedzte nám, čo vás baví
a príďte k nám na Spark workshop
Ďakujeme

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Real-time big data v tvojej samoške - Pygmalios Analytics