1. Streams as Scala Collections
S3 Scala Client with Play Iteratees and Composable Operations
Greg Silin
Platform Engineer
@gregsbriefs
www.github.com/nitro/streamcollections
ScalaDays 2015
2. Agenda
• Reactive at Nitro
• Smart Documents at Scale
• Motivation for Streaming Collections
• Building Streams with Iteratees
• Streams as Scala Collections
• Applications
• Questions
3. The Old Way
Create & Prepare
On the Desktop
Print
Document
Sign Printed
Document
Scan Into
Computer
4. Knowledge workers spend approximately 11+ hours a week
creating and managing documents
The New Way
Create Prepare
Sign
(Anywhere)
5. Nitro accelerates the way
businesses create, prepare, and
sign documents.
Anytime and anywhere.
Smarter Documents for EveryoneTM
6. Reactive Systems at Nitro
react to user expectations <- responsive
react to state changes <- message driven
react to variable load <- elastic
react to failure <- resilient
8. Smart Documents at Scale
Each action results in a new document version
render sign approve
...
9. Smart Documents at Scale
documents / second *
versions / document *
pages / version =
billions of objects in S3
10. Smart Documents at Scale
millions of new document uploads a day
100MM+/day document state changes resulting in 10x messages
billions of objects in S3
11. Motivation for Streaming Collections
counting
copying
extracting
cleanup
become non-trivial at scale
12. Motivation for Streaming Collections
1 percent error margin = 10M objects
That’s money for the business
43. Streams as Scala Collections - Applications
Can extend this model onto other data
sources
We don’t have to stop at S3
➔ Relational DB
➔ ElasticSearch
➔ HBase / Cassandra
➔ Spark
44. "Much of my work has come from being lazy." - John Backus
Quoted in the IBM employee magazine Think in 1979 (http://en.wikiquote.org/wiki/John_Backus)
45. What We Learned
Iteratees are good for traversing large volume of data
Programming iteratees can get a bit tricky
Scaling ain’t easy
Stream Collections abstraction makes streams simple
46. Future of Streams as Scala Collections
Continue developing a reactive S3 Client
In use in Nitro Production
Introduce other stream implementations
(akka streams, etc)
48. San Francisco Scala Days 2015
• Nitro is a Gold sponsor
• Meet us at our community booth
sfscala.org:
• Wed: Scala D’Ehs meetup @ Stock in Trade
• Thu: unconference @ Galvanize
• Thu evening: Spark Notebook & Rapture @ Nitro
• Fri: free Shapeless training @ Nitro