SlideShare a Scribd company logo
STREAMS ON
TOP OF SCALA
BY @WAXZCE – QUENTIN ADAM
LAMBDACON 2015 BOLOGNA
Quentin ADAM from the Clever Cloud
@waxzce on twitter – github- soundcloud – instagram ….
WHO AM I ?
MY DAY TO DAY WORK :
CLEVER CLOUD, MAKE YOUR
APP RUN ALL THE TIME
And learn a lot of things about your code, apps, and good/bad design…
KEEP YOUR APPS ONLINE. MADE WITH
NODE.JS, SCALA, JAVA, RUBY, PHP,
PYTHON, GO OR DOCKER…
AND LEARN A LOT OF THINGS ABOUT
YOUR CODE, APPS, AND GOOD/BAD
DESIGN…
WHY ARE STREAMS SO
TRENDY THESE DAYS?
2 MAIN
REASONS
DATA IS BECOMING
BIGGER AND BIGGER
WE NEED TO ACT WHILE
DATA TRANSFERRING IS
OCCURRING
&
WE ARE NOW USING
LOTS OF PERMANENT
CONNECTIONS
REALITY FOR
MANY
DEVELOPERS
WEBSOCKETS
HTTP/2
EXAMPLE
WHAT IS INSIDE AN
HTTP REQUEST ?
Verb
• The action
Resource
• The object of the action
Headers
• The context of the action
Body
• Optional
• The datas
IN MANY CASES THE REQUEST IS
MANIPULATED ALL FROM MEMORY
UPLOADING A
20 GB FILE ON
A POST
REQUEST
AND STORING IT
EXAMPLE
IT’S A BAD IDEA TO PUT THE BODY
PART IN MEMORY
CREATE A TEMP FILE TO STORE THE
DATA
I HATE FILE
SYSTEMS
I HATE FILE
SYSTEMS
DO NOT USE THE FILE
SYSTEM AS A DATASTORE
File systems are POSIX compliant
• POSIX is ACID
• POSIX is powerful but is a bottleneck
• File System is the nightmare of ops
• File System creates coupling (host provider/OS/language)
• SPOF-free multi tenant File System is a unicorn
Client
uploads
file
Create a
temp file
Send a
file in a
backend
Then
answer to
the client
The file is
transferring two
times
NOT SO GOOD
Client
uploads file
Directly
stream it to
the backend
Then
answer to
the client
LET’S ACT ON STREAMS!
CLASSIC JAVA STREAM
MANAGEMENT
CLASSIC JAVA STREAM
MANAGEMENT
• Buffers
• Buffer management
• Buffer exception
• Buffer overflow
CLASSIC JAVA STREAM
MANAGEMENT
• Low performances if not buffered
• Not modular
• Thread blocking
• Code is ugly
• No back pressure
• Error handling is bad
• i/o management and business code are mixed
I CAN’T SLEEP AT NIGHT
WE HAVE TO FIND A BETTER WAY
DATA
STRUCTURES
TO EXPRESS
DATA STREAM
MANAGEMENT
PLAY-
ITERATEES
FIRST OPTION
Like a recipe
Consume the data
ITERATEE : HOW TO MANAGE A STREAM
Produce the data
ENUMERATOR : DATA STREAM
Set of tools to do cool things with Iteratee and Enumerator
ENUMERATEE
SIMPLE EXAMPLE TO START
WHAT’S OUR GOAL
• Get Reactive Manifesto words
• Stream it to an iteratee to group it by pair of word
• Print it
AN ENUMERATOR
AN ITERATEE
input
EOF
EmptyEl
Iteratee
State
Done
ErrorCont
AN ITERATEE
AN ITERATEE TO
MANAGE THE STREAM
Streams on top of scala - #lambdaCon
AN ITERATEE
Streams on top of scala - #lambdaCon
ITERATEE
COMPOSITION
Streams on top of scala - #lambdaCon
PURELY FUNCTIONAL
TYPE SAFE
COMPOSITION
WHAT’S
TRENDY?
BUT ITERATEES ARE GOING TO DIE
SCALAZ STREAMS
WHAT’S IN
THE BOX ?
BASED ON SCALAZ
BASICS
PROCESS IS KEY
SIMPLY USE THE
COLLECTION API
DEMO
BINDINGS WITH
• http with (netty or http4s)
• scodec
• …
BUT WE
NEED TO
TALK WITH
OTHERS…
LIKE OUR
FRIENDS
ON TOP OF
JVM
AND THEY
HAVE LESS
EXPRESSIVE
TYPE
SYSTEM
+ POLITICS
REACTIVE
STREAMS
ENTER
AKKA
STREAMS
CURRENT 1.0-M5 (MILESTONE) (M5 OUT
YESTEDAY)
BASIC EXAMPLE
BASIC EXAMPLE
DEMO AGAIN
MORE POSSIBILITIES
Grab from
rabbitMQ
Parse Event
Check event
ACL from
DB
Find reliable
WS
Send data to
WS
ARE YOU CONVINCE
TO USE STREAM ?
GO NOW
Iteratee
Scalaz-
streams
Akka-
stream
• learn
• Act now on play!
• Beautiful design
• The most scala-ish
way to do
• Enterprise compatible
• Wide ecosystem
• Reactive stream
ready
DATA STREAMING
PROGRAMMING IS NOW
TRENDING
THX TO @CLEMENTD
CLEMENT DELAFARGUE
I’m @waxzce on twitter
I’m the CEO of
A PaaS provider, give it a try
;-)
THX FOR LISTENING
& QUESTIONS TIME
Coupon for Clever Cloud trial :
lambdacon

More Related Content

PPTX
Streams on top of Scala - scalar 2015 Warsaw
PPTX
Use Promises, Futures and some functional programing stuff without being a ma...
PPTX
Why postgres SQL deserve noSQL fan respect - Riga dev day 2016
PPTX
How to manage large amounts of data with Iteratee - ScalaDays Berlin 2014
PPTX
Sponsor Presentation: Maropost
PPTX
Immutability: from code to infrastructure, the way of scalability - snowcamp ...
PPTX
RabbitMQ 101 : job scheduling, micro service communication, event based data...
PPTX
How to scale your applications ? - #bzhcamp
Streams on top of Scala - scalar 2015 Warsaw
Use Promises, Futures and some functional programing stuff without being a ma...
Why postgres SQL deserve noSQL fan respect - Riga dev day 2016
How to manage large amounts of data with Iteratee - ScalaDays Berlin 2014
Sponsor Presentation: Maropost
Immutability: from code to infrastructure, the way of scalability - snowcamp ...
RabbitMQ 101 : job scheduling, micro service communication, event based data...
How to scale your applications ? - #bzhcamp

What's hot (20)

PPTX
Immutability: from code to infrastructure, the way to scalability - Breizhca...
PPT
Widening your JavaScript Application
PPTX
The end of server management : hosting have to become a commodity - #devoxxPL...
PPTX
DEVOPS AND IT AUTOMATION, THE WAY OF THE EFFICIENT DEVELOPER - Wolves Summit ...
PPTX
HTTP/2 : why upgrading the web? - DjangoCon Europe 2016 Budapest
PPTX
Be a modern developer ! #liveCoding #cloud #docker #akka #scala #amqp - at Ch...
PPT
Getting Started with WordPress GA
PPTX
I want to be an efficient developper - APIdays Berlin 2014
PDF
Moore vs. May - everything is faster and better: we can fix that
PPTX
Iteratee and stream with Play2 scala
PPTX
Why do you need Clever Cloud ?
PDF
The Platform Era, Software and APIs in the organization change
PPTX
Akka.Net Ottawa .NET User Group Meetup
PPT
WordPress Bootcamp GA
PPTX
Cyber-security tips: the heartbleed bug
PDF
PC/Mac/Linux: Multi-platform web development made simple
PDF
From Twitter App idea to Mashable.com in 24h
PPTX
Intro to Netflix's Chaos Monkey
PPTX
I want to be an efficient developper. Mix-IT version
PDF
Unearthed Arcana for Web People
Immutability: from code to infrastructure, the way to scalability - Breizhca...
Widening your JavaScript Application
The end of server management : hosting have to become a commodity - #devoxxPL...
DEVOPS AND IT AUTOMATION, THE WAY OF THE EFFICIENT DEVELOPER - Wolves Summit ...
HTTP/2 : why upgrading the web? - DjangoCon Europe 2016 Budapest
Be a modern developer ! #liveCoding #cloud #docker #akka #scala #amqp - at Ch...
Getting Started with WordPress GA
I want to be an efficient developper - APIdays Berlin 2014
Moore vs. May - everything is faster and better: we can fix that
Iteratee and stream with Play2 scala
Why do you need Clever Cloud ?
The Platform Era, Software and APIs in the organization change
Akka.Net Ottawa .NET User Group Meetup
WordPress Bootcamp GA
Cyber-security tips: the heartbleed bug
PC/Mac/Linux: Multi-platform web development made simple
From Twitter App idea to Mashable.com in 24h
Intro to Netflix's Chaos Monkey
I want to be an efficient developper. Mix-IT version
Unearthed Arcana for Web People
Ad

Similar to Streams on top of scala - #lambdaCon (20)

PDF
Stapling and patching the web of now - ForwardJS3, San Francisco
PPTX
Why PG deserves noSQL fans' respect
PDF
Of innovation and impatience - Future Decoded 2015
PPTX
Dapper: the microORM that will change your life
PPTX
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
PPTX
Why postgres SQL deserve noSQL fan respect - Devoxx Fr 2015
PPTX
DevDay 2013 - Building Startups and Minimum Viable Products
PPTX
Immutability: from code to infrastructure, the way to scalability - Voxxed Da...
PPTX
Immutability - open source summit paris 2015
PPTX
From delivering plugins to delivering "as a Service" - Atlassian connect 2017
PDF
Responsive, adaptive and responsible - keynote at NebraskaJS
PDF
Achieving Technical Excellence in Your Software Teams - from Devternity
PDF
Let’s learn how to use JavaScript responsibly and stay up-to-date.
PDF
The JavaScript Delusion
PPTX
Terraform - The Road to Self-Service
PPTX
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PPTX
How I Learned to Stop Worrying and Love Legacy Code.....
PPTX
Performance tuning
PDF
Getting Spark ready for real-time, operational analytics
PDF
2019 StartIT - Boosting your performance with Blackfire
Stapling and patching the web of now - ForwardJS3, San Francisco
Why PG deserves noSQL fans' respect
Of innovation and impatience - Future Decoded 2015
Dapper: the microORM that will change your life
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
Why postgres SQL deserve noSQL fan respect - Devoxx Fr 2015
DevDay 2013 - Building Startups and Minimum Viable Products
Immutability: from code to infrastructure, the way to scalability - Voxxed Da...
Immutability - open source summit paris 2015
From delivering plugins to delivering "as a Service" - Atlassian connect 2017
Responsive, adaptive and responsible - keynote at NebraskaJS
Achieving Technical Excellence in Your Software Teams - from Devternity
Let’s learn how to use JavaScript responsibly and stay up-to-date.
The JavaScript Delusion
Terraform - The Road to Self-Service
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
How I Learned to Stop Worrying and Love Legacy Code.....
Performance tuning
Getting Spark ready for real-time, operational analytics
2019 StartIT - Boosting your performance with Blackfire
Ad

More from Quentin Adam (20)

PPTX
Beyond Interoperability : Versatility as the future of Cloud services
PPTX
Lunaconf DIgital Market in Europe talk for Tech
PPTX
Opening Keynote : Domestic Digital market - Jug summercamp 2024
PPTX
Biscuit, the cryptotoken you can share safely with your ap is
PPTX
Keynot Cloud Expo Intel
PPTX
Pulsar 101 at devoxx
PPTX
Traversing hyper driven developpement to do great technical choices and make ...
PPTX
How to make people work together? - ending keynote - devfest du bout du monde...
PPTX
Remove centralization on Authorization - API Days Paris 2018 (announcement fo...
PPTX
PostgreSQL is the new NoSQL - at Devoxx 2018
PPTX
Hype driven architecture - keynote at devfest Toulouse 2018
PPTX
Real world code, why are you so ashamed? - RivieraDev 2018
PPTX
Monitorer l'inconnu, 1000 * 100 series par jour - talk avec @clementd à #devo...
PPTX
Comment les contrôleurs de gestion ont fuck up mon IT - Lean Kanban France 2017
PPTX
Monitoring the unknown, 1000*100 series a day - Big Data Vilnius 2017
PPTX
Problems you’ll face in the Microservices World: Configuration, Authenticatio...
PPTX
MONITORING THE UNKNOWN, 1000*100 SERIES A DAY - DEVOXX MOROCCO 2017
PPTX
Build a reverse proxy for modern immutable infrastructure - Sozu - Devops D D...
PDF
What is Clever Cloud?
PPTX
Why all my software projects are late?
Beyond Interoperability : Versatility as the future of Cloud services
Lunaconf DIgital Market in Europe talk for Tech
Opening Keynote : Domestic Digital market - Jug summercamp 2024
Biscuit, the cryptotoken you can share safely with your ap is
Keynot Cloud Expo Intel
Pulsar 101 at devoxx
Traversing hyper driven developpement to do great technical choices and make ...
How to make people work together? - ending keynote - devfest du bout du monde...
Remove centralization on Authorization - API Days Paris 2018 (announcement fo...
PostgreSQL is the new NoSQL - at Devoxx 2018
Hype driven architecture - keynote at devfest Toulouse 2018
Real world code, why are you so ashamed? - RivieraDev 2018
Monitorer l'inconnu, 1000 * 100 series par jour - talk avec @clementd à #devo...
Comment les contrôleurs de gestion ont fuck up mon IT - Lean Kanban France 2017
Monitoring the unknown, 1000*100 series a day - Big Data Vilnius 2017
Problems you’ll face in the Microservices World: Configuration, Authenticatio...
MONITORING THE UNKNOWN, 1000*100 SERIES A DAY - DEVOXX MOROCCO 2017
Build a reverse proxy for modern immutable infrastructure - Sozu - Devops D D...
What is Clever Cloud?
Why all my software projects are late?

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
KodekX | Application Modernization Development
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KodekX | Application Modernization Development
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.

Streams on top of scala - #lambdaCon