SlideShare a Scribd company logo
1 of 35
Download to read offline
●
●
○
○
○
●
○
○
○
●
In computer science, a stream is a sequence of data elements made available over time. A stream can be thought of as items on a conveyor
belt being processed one at a time rather than in large batches.
Streams are processed differently from batch data – normal functions cannot operate on streams as a whole, as they have potentially
unlimited data, and formally, streams are codata (potentially unlimited), not data (which is finite). Functions that operate on a stream,
producing another stream, are known as filters, and can be connected in pipelines, analogously to function composition. Filters may operate
on one item of a stream at a time, or may base an item of output on multiple items of input, such as a moving average.
Wikipedia https://en.wikipedia.org/wiki/Stream_(computing)
●
●
○
○
●
○
○
https://ci.apache.org/projects/flink/flink-docs-release-1.1/fig/stack.png
●
●
●
https://www.youtube.com/watch?v=-LiZR1457Kw
5s 10s 15s 25s
Tumbling window:
5s 10s 11s 16s
8s 13s 14s 19s
Sliding window:
stream.keyBy(0).window(TumblingEventTimeWindows.of(Time.seconds(5)))
stream.keyBy(0).window(SlidingEventTimeWindows.of(Time.seconds(5), Time.seconds(2)))
5s 12s 13s 25s
Counting window:
5s 15s 20s
Session window:
stream.keyBy(0).countWindow(4)
stream.keyBy(0).window(EventTimeSessionWindows.withGap(Time.seconds(5)))
5s 10s 15s 25s
2s 3s 4s 8s 11s 9s14s 11s 11s 14s 9s
5s 10s 15s 25s
2s 3s 4s 8s 11s 9s14s 11s 11s 14s 9s
Late EventOut of Order Event
https://ci.apache.org/projects/flink/flink-docs-release-1.2/fig/tasks_slots.svg
https://ci.apache.org/projects/flink/flink-docs-release-1.1/concepts/fig/processes.svg
●
●
●
●
https://www.youtube.com/watch?v=_qWs_rMUKPQ
https://ci.apache.org/projects/flink/flink-docs-release-1.1/internals/fig/stream_barriers.svg
https://ci.apache.org/projects/flink/flink-docs-release-1.1/internals/fig/stream_aligning.svg
https://ci.apache.org/projects/flink/flink-docs-release-1.1/internals/fig/checkpointing.svg
https://www.youtube.com/watch?v=9VjiIKco3bE
Spark
➖
➖
➖
➖
Storm
➖
Kafka-streams
Samza
Samza
➖
➖
Największy job ma ponad 20 operatorów, działa na 5000 vCorów w
1000 węzłowym klastrze.
Zadania przetwarzające 30 miliardów eventów dziennie, utrzymując
stan setek GB z zapewnieniem jednokrotnego przetwarzania.
30 aplikacji używanych na produkcji przez ponad rok. 10 miliardów
eventów przetwarzanych dziennie(2TB)
https://www.youtube.com/watch?v=NI1yN5FbxUM
Najciekawsze
funkcjonalności
val env = StreamExecutionEnvironment.getExecutionEnvironment
val tableEnv = TableEnvironment.getTableEnvironment(env)
val eventSteam = ...
tableEnv.registerDataStream("events", eventStream)
tableEnv.sql("select * from events where elem = 'AddCredit'").toDataStream[QueryableButtonClickEvent].print()
eventStream.toTable(tableEnv).where('elem === "AddCredit").toDataStream[QueryableButtonClickEvent].print()
env.execute("Sql job")
SQL
Table API
Register table
https://www.youtube.com/watch?v=vws5bv3XdD8&feature=youtu.be
https://flink.apache.org/img/blog/stream-sql/new-table-api.png
1
2
val shortSessionPattern = Pattern
.begin[ClickEvent]("login").subtype(classOf[LoginClickEvent])
.followedBy("logout").within(Time.seconds(5))
CEP.pattern(eventStream, shortSessionPattern).select(events =>
s"User: ${events("login").userId} spent just
${(events("logout").timestamp - events("login").timestamp) / 1000} seconds"
).print()
https://www.youtube.com/watch?v=vws5bv3XdD8&feature=youtu.be
val creditCardRequest = Pattern
.begin[ClickEvent]("credit").subtype(classOf[ButtonClickEvent]).where(_.elem == Element.AddCredit)
.followedBy("card").subtype(classOf[ButtonClickEvent]).where(_.elem == Element.RequestCard)
CEP.pattern(eventStream, creditCardRequest).select(events =>
s"User: ${events("credit").userId} probably wants a credit"
).print()
KV Store
Query Client
https://www.youtube.com/watch?v=uuv-lnOrD0o&feature=youtu.be
Query Client
Live demo
Dawid Wysakowicz
@OneMoreCoder
dawidwys
wysakowicz.dawid@gmail.com
●
○
○
○
○
●
○
■
■
●
○
○
○

More Related Content

Similar to Strumienie i wiewiórka

Loophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in ChromeLoophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in Chrome
cgvwzq
 

Similar to Strumienie i wiewiórka (20)

Apache Flink for IoT: How Event-Time Processing Enables Easy and Accurate Ana...
Apache Flink for IoT: How Event-Time Processing Enables Easy and Accurate Ana...Apache Flink for IoT: How Event-Time Processing Enables Easy and Accurate Ana...
Apache Flink for IoT: How Event-Time Processing Enables Easy and Accurate Ana...
 
GOoDA tutorial
GOoDA tutorialGOoDA tutorial
GOoDA tutorial
 
K. Tzoumas & S. Ewen – Flink Forward Keynote
K. Tzoumas & S. Ewen – Flink Forward KeynoteK. Tzoumas & S. Ewen – Flink Forward Keynote
K. Tzoumas & S. Ewen – Flink Forward Keynote
 
Loophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in ChromeLoophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in Chrome
 
Apache Flink Stream Processing
Apache Flink Stream ProcessingApache Flink Stream Processing
Apache Flink Stream Processing
 
Kostas Tzoumas - Stream Processing with Apache Flink®
Kostas Tzoumas - Stream Processing with Apache Flink®Kostas Tzoumas - Stream Processing with Apache Flink®
Kostas Tzoumas - Stream Processing with Apache Flink®
 
Debunking Common Myths in Stream Processing
Debunking Common Myths in Stream ProcessingDebunking Common Myths in Stream Processing
Debunking Common Myths in Stream Processing
 
Flink Forward SF 2017: Kenneth Knowles - Back to Sessions overview
Flink Forward SF 2017: Kenneth Knowles - Back to Sessions overviewFlink Forward SF 2017: Kenneth Knowles - Back to Sessions overview
Flink Forward SF 2017: Kenneth Knowles - Back to Sessions overview
 
Data Warehouse Automation Conference - Tom Breur: Cycle time & Automation 201...
Data Warehouse Automation Conference - Tom Breur: Cycle time & Automation 201...Data Warehouse Automation Conference - Tom Breur: Cycle time & Automation 201...
Data Warehouse Automation Conference - Tom Breur: Cycle time & Automation 201...
 
About time
About timeAbout time
About time
 
Building Applications with Streams and Snapshots
Building Applications with Streams and SnapshotsBuilding Applications with Streams and Snapshots
Building Applications with Streams and Snapshots
 
Unified Stream and Batch Processing with Apache Flink
Unified Stream and Batch Processing with Apache FlinkUnified Stream and Batch Processing with Apache Flink
Unified Stream and Batch Processing with Apache Flink
 
Data Stream Processing - Concepts and Frameworks
Data Stream Processing - Concepts and FrameworksData Stream Processing - Concepts and Frameworks
Data Stream Processing - Concepts and Frameworks
 
Serverless London 2019 FaaS composition using Kafka and CloudEvents
Serverless London 2019   FaaS composition using Kafka and CloudEventsServerless London 2019   FaaS composition using Kafka and CloudEvents
Serverless London 2019 FaaS composition using Kafka and CloudEvents
 
Apache Flink internals
Apache Flink internalsApache Flink internals
Apache Flink internals
 
Apache Flink(tm) - A Next-Generation Stream Processor
Apache Flink(tm) - A Next-Generation Stream ProcessorApache Flink(tm) - A Next-Generation Stream Processor
Apache Flink(tm) - A Next-Generation Stream Processor
 
Flexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkFlexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache Flink
 
Ten practical ways to improve front-end performance
Ten practical ways to improve front-end performanceTen practical ways to improve front-end performance
Ten practical ways to improve front-end performance
 
Rundeck's History and Future
Rundeck's History and FutureRundeck's History and Future
Rundeck's History and Future
 
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data ProcessingCloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 

Recently uploaded (20)

Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 

Strumienie i wiewiórka