SlideShare a Scribd company logo
1 of 46
Download to read offline
ScalaDays Highlights
2015
Who?
● BoldRadius Solutions
○ boldradius.com
○ Typesafe Partner
○ Scala, Akka and Play specialists
○ Ottawa, Saskatoon, San Francisco, Boston, Chicago, Montreal, New
York, Toronto
● Michael Nash, VP Capabilities
● Adam Murray, VP Business
Our Team
at ScalaDays
What?
What was ScalaDays all about?
● Held in San Francisco March 16th thru 18th
○ About 800 attendees
○ Three categories (intermediate, beginner,
advanced),
○ Four tracks, 55 presentations, three keynotes
● Followed by Two Intensive Training days
○ All the Typesafe courses offered
Venue: Fort Mason
The main hall...
Keynotes
● Martin Odersky, Chief Architect & Co-Founder at Typesafe
○ Scala - where it came from, where it’s going
● Danese Cooper, Distinguished Member of Technical Staff -
Open Source at Paypal
○ Open Languages
● Dianne March, Director of Engineering Tools at Netflix
○ Technical Leadership from wherever you are
Quote from James Gosling...
Highlights
Too many great sessions to summarize them all, we have
to extract a few recurring themes…
○ Distributed Application Design and Development
○ Big Data/Fast Data
○ Types and Safe Scala
○ Performance and Scalability
Distributed Applications
● Life Beyond the Illusion of Present
● Reactive Reference Architectures
● Akka in Production: Why and How
● Easy Scalability with Akka
● Scalable task distribution with Scala, Akka
and Mesos
● A Guided Tour of a Distributed Application
Performance and Scalability
● Scala Collections and Performance
● Shattering Hadoop’s Large-Scala Sort Record with
Spark and Scala
● Type-safe off-heap memory for Scala
● Akka in Production: Why and How
● Easy Scalability with Akka
● The JVM Backend and Optimizer in Scala 2.12
Big Data, Fast Data
● Shattering Hadoop’s Large Scala Sort Record with
Spark and Scala
● Scala - The Real Spark of Data Science
● Apache Spark: A Large Community Project in Scala
● S3 at Scala: Async Scala Client with Play Iteratees and
Composable Operations
● The Unreasonable Effectiveness of Scala for Big Data
● Scalable task distribution with scala, Akka and Mesos
Types and Safer Scala
● Keynote: Scala - where it came from, where it’s going
● Towards a Safer Scala
● Leveraging Scala Macros for Better Validation
● Type-level programming in Scala 101
● Improving Correctness with Types
● Happy Paths: Functional Constructs in the Wild
● The Scalactic Way
● Delimited dependency-typed monadic checked
exceptions
The Rest...
Many excellent talks were outside these categories
● Why Scala.js
● Reactive Slick for Database Programming
● Exercise in machine learning
● Functional Natural Language Processing
● If I Only Had a Brain...in Scala
● Akka HTTP: the Reactive Web Toolkit
● many many others
Highlights of Specific Sessions
A quick taster of what was in some of the more
popular sessions...
Scala - Where it came from, where it’s going
Where it’s from, where it’s going
“Scala is a gateway drug to Haskell” (in actual fact it’s going well beyond Haskell.)
Slides: http://www.slideshare.net/Odersky/scala-days-san-francisco-45917092
Came from a practical combination of OOP and functional programming
- Funny story about hipster syntax (..) instead of [..], <..> instead of [..], ??? instead of <..>
- Trend in Type Systems
- Scala JS is no longer experimental
- TASTY: new scala-specific platform
- Introduction to DOT
- Type Parameters
- Better treatment of effects with implicit Functions instead of Monads
TASTY
Scala faces challenges:
● binary compatibility
● having to pick a platform: JDK( 7,8,9,10, ?) or Javascript.
Proposing a scala-specific platform called TASTY, (serialized typed abstract syntax tree),
as an intermediate representation before bytecode - carries metadata of types, can be compiled with
different versions of JDK, and to Javascript.
Tasty will enable:
● instrumentation
● optimization
● code analysis
● refactoring
● publish once run anywhere
● automated remapping to solve binary compatibility issues.
Explorations:
Implicits that compose
Explorations:
Hope to find something cooler than Monads to handle effects.
● Monads don’t commute
● Require Monad transformers for composition
● Monad transformers make Martin’s head explode
Toward a Safer Scala
Leif Wickland
http://tinyurl.com/sd15lint
● Scalac enables some error-prone code.
○ head of empty List?
● Using Static Analysis to detect errors early
● IDE based solutions
○ Inconsistencies
○ If not in release build process, doesn’t exist
● Web-based analysis
○ outside of compile loop
○ relatively immature analysis
Scalac switches
● Scala Style
● Wart Remover
● Linter
● Watch
○ Abide
○ Scapegoat
○ Supersafe
Life Beyond the Illusion of Present
Jonas Bonér:
The idea of the present is an illusion. Everything we see, hear and feel is just
an echo from the past. But this illusion has influenced us and the way we view
the world in so many ways.
There is no present, all we have is facts derived from the merging of multiple
pasts. The truth is closer to Einstein’s physics where everything is relative to
one’s perspective. As developers we need to wake up and break free from the
perceived reality of living in a single globally consistent present.
The advent of multicore and cloud computing architectures meant that most
applications today are distributed systems—multiple cores separated by the
memory bus or multiple nodes separated by the network—which puts a harsh
end to this illusion.
The only way to design truly scalable and performant systems that can
construct a sufficiently consistent view of history—and thereby our local
“present”—is by treating time as a first class construct in our programming
model and to model the present as facts derived from the merging of multiple
concurrent pasts.
How do we deal with failure and communication unreliability in real life?
Confirmation and repetition
We can’t force the world into a globally consistent present (CRUD).
Mentioned 2 paradigms/theories:
● CALM (consistency as logical monotonicity)
● CRDT (Commutative Replicated Data Type)
CRDT (Commutative Replicated Data Type) eventually consistent data types
● minimize contention / coordination in a distributed system.
● set, maps, graphs: rich data types.
● monotonic merge function: all state change is monotonically increasing, no way
back.
Improving Correctness with Types
http://workday.github.io
● Using Wrapper Types (aka Tiny Types) instead of primitives
● Never use null, or throw Exceptions
● use === org.scalactic.TypeCheckedTripleEquals
○ requires the types of the two values compared to be in a subtype/supertype
● Never Use Non-Empty Lists when a list must be populated (org.scalactic.Every)
● Use Type Tags (ala Shapeless, Scalaz)
● Use Path Dependent Types
● Other reading
○ Self recursive types
○ Phantom Types
○ Shapeless
○ Scalactic
Types: Defensive Programming. Fail Fast. Design By Contract.
Function Passing Style
Heather Miller:
● A new programming model called function passing designed to overcome many of
imperative / weakly-typed issues found in traditional “big data” processing
systems.
● Provides a more principled substrate on which to build data-centric distributed
systems.
● Pass safe, well-typed serializable functions to immutable distributed data
● Based on her work on Pickling and Spores
● Uses Spores (Serializable Functions) for a distributed model.
● Kind of an Inverse of the Actor Model
● Stateless. data is stationary, functions are passed around.
● Uses Data Silos accessed through a Silo Ref.
The Unreasonable Effectiveness of Scala for Big Data
Dean Wampler
● How Hadoop Works - Map Reduce
○ Problems
■ Hard to implement algorithms
■ The Hadoop API is horrible
● Scalding
○ An improved Hadoop API in Scala
○ Problems
■ Still uses a batch mode
● Spark
○ An elegant, functional API
○ Still in Batch Mode, but with mini batches which
approach real time.
Akka HTTP: The Reactive Web Toolkit
Roland Kuhn
● Replaces Spray
● Uses Akka Streams
○ Sources emit values to the stream
○ Sinks receive values, act on them
○ Sources can compose using Zip and Graph shapes
● “The pinball interpreter”
○ produce data
○ move downstream through transformations
○ get to the effect
○ go up and ask for more data
○ Filters interrupt the flow before getting to the effect, make the pinball go back
upstream.
● A live coded demonstration of using Streams and Http
● Expected timeline for Streams - 4 weeks
● Expected timeline for Http - 8 weeks
The Scalactic Way
Bill Venners
http://www.slideshare.net/bvenners/the-scalactic-way
ScalaTest: quality through tests
Scalactic: quality through types
SuperSafe: quality through static analysis
Reactive Slick for Database Programming
Stefan Zeiger
http://slick.typesafe.com/talks/scaladays2015sf/Reactive_Slick_for_Database_Programming.pdf
Slick 3.0
● JDBC is inherently blocking (and blocking ties up threads)
● Traditional Model
○ Fully synchronous
○ One thread per web request
○ Contention for Connections (getConnection blocks)
○ Database back-pressure creates more blocked threads
○ Doesn’t scale
New Slick Architecture makes use of a new DataType to provide
Asynchronous Database I/O
● based on State, IO and Free Monads.
● Returns a Future[R]
● Creates a separate ExecutionContext, avoiding blocking of current thread
● Works with akka-streams to create back pressure, so DB only gives as much data as client can
process.
● For performance purposes it pre-fetches some data to keep client busy while it waits for the next
portion from DB.
sealed trait DBIOAction[+R, +S <: NoStream, -E <: Effect]{
def map[R2](f: R => R2)(implicit executor: ExecutionContext): DBIOAction[R2, NoStream, E]
def flatMap[R2, S2 <: NoStream, E2 <: Effect](f: R => DBIOAction[R2, S2, E2])(implicit
executor: ExecutionContext): DBIOAction[R2, S2, E with E2]
...
}
Easy Scalability with Akka
Easy Scalability with Akka
Michael Nash
● Reviewed Akka, CQRS, ES
● Introduced Distributed DDD
● Identical clustered system with DDDD and Without
● Gatling performance tests on both
ConductR
● Application manager that empowers ops to
deploy distributed systems
● Uses Akka, Play, Aka Streams, Akka
Cluster, FSM, Akka Data Replication
● How can we run cluster based apps ensuring
the seed nodes are started first?
○ State replicated using Data
Replication
● How can we consolidate logging?
○ Using Akka Streams
● How can we avoid batching?
○ Use Event Driven Architecture
● How can monitor/test multiple nodes?
○ Use the visualizer built into conductor
● How can we share state among the nodes?
○ Use Akka Data Replication
Scala.js
Building a data-driven map of the world in 10
minutes….
Whats wrong with Webapps?
● Everything String/Map[String, String]
● Compiler cannot help you!
○ document.getElementByld("my-id")
● Javascript!
○ ["10", "10", "10", "10"].map(parseInt) [10, NaN, 2, 3] // WTF
ScalaJS
● lets you write webapp in one language
● Swap String-typing for Strong-typing
● Type Everything!!
○ val res: Future[Seq[String]] = Ajax[Api].list(inputBox.value).call()
● IS NOT JAVASCRIPT
○ scala.js> List("10", "10", "10", "10").map(parseInt) List(10, 10, 10, 10)
// Yay!
The BoldRadius Crew Packing up...
The End….
ScalaDays Amsterdam!
● June 8th to 10th
● Followed by Training
Q & A
michael.nash@boldradius.com
adam.murray@boldradius.com

More Related Content

What's hot

What's hot (20)

Anatomy of Data Source API : A deep dive into Spark Data source API
Anatomy of Data Source API : A deep dive into Spark Data source APIAnatomy of Data Source API : A deep dive into Spark Data source API
Anatomy of Data Source API : A deep dive into Spark Data source API
 
Scala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud PlatformScala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud Platform
 
Spark architecture
Spark architectureSpark architecture
Spark architecture
 
Migrating to Spark 2.0 - Part 2
Migrating to Spark 2.0 - Part 2Migrating to Spark 2.0 - Part 2
Migrating to Spark 2.0 - Part 2
 
Introduction to Spark - DataFactZ
Introduction to Spark - DataFactZIntroduction to Spark - DataFactZ
Introduction to Spark - DataFactZ
 
Continuous delivery for machine learning
Continuous delivery for machine learningContinuous delivery for machine learning
Continuous delivery for machine learning
 
Lambda architecture @ Indix
Lambda architecture @ IndixLambda architecture @ Indix
Lambda architecture @ Indix
 
How to Choose a Deep Learning Framework
How to Choose a Deep Learning FrameworkHow to Choose a Deep Learning Framework
How to Choose a Deep Learning Framework
 
When Apache Spark Meets TiDB with Xiaoyu Ma
When Apache Spark Meets TiDB with Xiaoyu MaWhen Apache Spark Meets TiDB with Xiaoyu Ma
When Apache Spark Meets TiDB with Xiaoyu Ma
 
Riak perf wins
Riak perf winsRiak perf wins
Riak perf wins
 
Ledingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @LendingkartLedingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @Lendingkart
 
Lambda architecture: from zero to One
Lambda architecture: from zero to OneLambda architecture: from zero to One
Lambda architecture: from zero to One
 
Infrastructure Provisioning in the context of organization
Infrastructure Provisioning in the context of organizationInfrastructure Provisioning in the context of organization
Infrastructure Provisioning in the context of organization
 
Spark Introduction
Spark IntroductionSpark Introduction
Spark Introduction
 
Ledingkart Meetup #4: Data pipeline @ lk
Ledingkart Meetup #4: Data pipeline @ lkLedingkart Meetup #4: Data pipeline @ lk
Ledingkart Meetup #4: Data pipeline @ lk
 
Understanding Implicits in Scala
Understanding Implicits in ScalaUnderstanding Implicits in Scala
Understanding Implicits in Scala
 
Scala Days NYC 2016
Scala Days NYC 2016Scala Days NYC 2016
Scala Days NYC 2016
 
BlackRay - The open Source Data Engine
BlackRay - The open Source Data EngineBlackRay - The open Source Data Engine
BlackRay - The open Source Data Engine
 
Sharing our best secrets: Design a distributed system from scratch
Sharing our best secrets: Design a distributed system from scratchSharing our best secrets: Design a distributed system from scratch
Sharing our best secrets: Design a distributed system from scratch
 
Eclipse RDF4J - Working with RDF in Java
Eclipse RDF4J - Working with RDF in JavaEclipse RDF4J - Working with RDF in Java
Eclipse RDF4J - Working with RDF in Java
 

Viewers also liked

Pow séminaire "Divine Protection"
Pow séminaire "Divine Protection"Pow séminaire "Divine Protection"
Pow séminaire "Divine Protection"
Alkauthar
 
Curriculum
CurriculumCurriculum
Curriculum
thipik
 

Viewers also liked (20)

Pattern Matching in Scala
Pattern Matching in ScalaPattern Matching in Scala
Pattern Matching in Scala
 
Empirics of standard deviation
Empirics of standard deviationEmpirics of standard deviation
Empirics of standard deviation
 
Test
TestTest
Test
 
Paul Partlow Highlighted Portfolio
Paul Partlow Highlighted PortfolioPaul Partlow Highlighted Portfolio
Paul Partlow Highlighted Portfolio
 
Code Brevity in Scala
Code Brevity in ScalaCode Brevity in Scala
Code Brevity in Scala
 
Cold drawn guide rail, Elevator guide Rail India
Cold drawn guide rail, Elevator guide Rail IndiaCold drawn guide rail, Elevator guide Rail India
Cold drawn guide rail, Elevator guide Rail India
 
Pow séminaire "Divine Protection"
Pow séminaire "Divine Protection"Pow séminaire "Divine Protection"
Pow séminaire "Divine Protection"
 
Functional Programming - Worth the Effort
Functional Programming - Worth the EffortFunctional Programming - Worth the Effort
Functional Programming - Worth the Effort
 
Curriculum
CurriculumCurriculum
Curriculum
 
Partial Functions in Scala
Partial Functions in ScalaPartial Functions in Scala
Partial Functions in Scala
 
String Interpolation in Scala | BoldRadius
String Interpolation in Scala | BoldRadiusString Interpolation in Scala | BoldRadius
String Interpolation in Scala | BoldRadius
 
Scala: Collections API
Scala: Collections APIScala: Collections API
Scala: Collections API
 
Value Classes in Scala | BoldRadius
Value Classes in Scala | BoldRadiusValue Classes in Scala | BoldRadius
Value Classes in Scala | BoldRadius
 
What Are For Expressions in Scala?
What Are For Expressions in Scala?What Are For Expressions in Scala?
What Are For Expressions in Scala?
 
Taste of korea
Taste of koreaTaste of korea
Taste of korea
 
Presentation1
Presentation1Presentation1
Presentation1
 
Earth moon 1
Earth moon 1Earth moon 1
Earth moon 1
 
Why Not Make the Transition from Java to Scala?
Why Not Make the Transition from Java to Scala?Why Not Make the Transition from Java to Scala?
Why Not Make the Transition from Java to Scala?
 
Punishment Driven Development #agileinthecity
Punishment Driven Development   #agileinthecityPunishment Driven Development   #agileinthecity
Punishment Driven Development #agileinthecity
 
Immutability in Scala
Immutability in ScalaImmutability in Scala
Immutability in Scala
 

Similar to Scala Days Highlights | BoldRadius

Similar to Scala Days Highlights | BoldRadius (20)

Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
 
Apache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-AriApache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-Ari
 
Stream, Stream, Stream: Different Streaming Methods with Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Spark and KafkaStream, Stream, Stream: Different Streaming Methods with Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Spark and Kafka
 
Stream, stream, stream: Different streaming methods with Spark and Kafka
Stream, stream, stream: Different streaming methods with Spark and KafkaStream, stream, stream: Different streaming methods with Spark and Kafka
Stream, stream, stream: Different streaming methods with Spark and Kafka
 
Sa introduction to big data pipelining with cassandra &amp; spark west mins...
Sa introduction to big data pipelining with cassandra &amp; spark   west mins...Sa introduction to big data pipelining with cassandra &amp; spark   west mins...
Sa introduction to big data pipelining with cassandra &amp; spark west mins...
 
What is Distributed Computing, Why we use Apache Spark
What is Distributed Computing, Why we use Apache SparkWhat is Distributed Computing, Why we use Apache Spark
What is Distributed Computing, Why we use Apache Spark
 
Data Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to ProductionData Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to Production
 
Spark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin OderskySpark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin Odersky
 
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and KafkaStream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
 
Experiences with Evangelizing Java Within the Database
Experiences with Evangelizing Java Within the DatabaseExperiences with Evangelizing Java Within the Database
Experiences with Evangelizing Java Within the Database
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
 Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F... Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
 
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
 
Nikhil summer internship 2016
Nikhil   summer internship 2016Nikhil   summer internship 2016
Nikhil summer internship 2016
 
How to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationsHow to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applications
 
A look under the hood at Apache Spark's API and engine evolutions
A look under the hood at Apache Spark's API and engine evolutionsA look under the hood at Apache Spark's API and engine evolutions
A look under the hood at Apache Spark's API and engine evolutions
 
AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
 
Spark Driven Big Data Analytics
Spark Driven Big Data AnalyticsSpark Driven Big Data Analytics
Spark Driven Big Data Analytics
 
Putting the Spark into Functional Fashion Tech Analystics
Putting the Spark into Functional Fashion Tech AnalysticsPutting the Spark into Functional Fashion Tech Analystics
Putting the Spark into Functional Fashion Tech Analystics
 

More from BoldRadius Solutions

More from BoldRadius Solutions (9)

Introduction to the Typesafe Reactive Platform
Introduction to the Typesafe Reactive PlatformIntroduction to the Typesafe Reactive Platform
Introduction to the Typesafe Reactive Platform
 
Towards Reliable Lookups - Scala By The Bay
Towards Reliable Lookups - Scala By The BayTowards Reliable Lookups - Scala By The Bay
Towards Reliable Lookups - Scala By The Bay
 
How You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in ProductionHow You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in Production
 
Introduction to the Actor Model
Introduction to the Actor ModelIntroduction to the Actor Model
Introduction to the Actor Model
 
Domain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureDomain Driven Design Through Onion Architecture
Domain Driven Design Through Onion Architecture
 
What are Sealed Classes in Scala?
What are Sealed Classes in Scala?What are Sealed Classes in Scala?
What are Sealed Classes in Scala?
 
How To Use Higher Order Functions in Scala
How To Use Higher Order Functions in ScalaHow To Use Higher Order Functions in Scala
How To Use Higher Order Functions in Scala
 
Scala Days 2014: Pitching Typesafe
Scala Days 2014: Pitching TypesafeScala Days 2014: Pitching Typesafe
Scala Days 2014: Pitching Typesafe
 
Demonstrating Case Classes in Scala
Demonstrating Case Classes in ScalaDemonstrating Case Classes in Scala
Demonstrating Case Classes in Scala
 

Scala Days Highlights | BoldRadius

  • 2. Who? ● BoldRadius Solutions ○ boldradius.com ○ Typesafe Partner ○ Scala, Akka and Play specialists ○ Ottawa, Saskatoon, San Francisco, Boston, Chicago, Montreal, New York, Toronto ● Michael Nash, VP Capabilities ● Adam Murray, VP Business
  • 4. What? What was ScalaDays all about? ● Held in San Francisco March 16th thru 18th ○ About 800 attendees ○ Three categories (intermediate, beginner, advanced), ○ Four tracks, 55 presentations, three keynotes ● Followed by Two Intensive Training days ○ All the Typesafe courses offered
  • 7. Keynotes ● Martin Odersky, Chief Architect & Co-Founder at Typesafe ○ Scala - where it came from, where it’s going ● Danese Cooper, Distinguished Member of Technical Staff - Open Source at Paypal ○ Open Languages ● Dianne March, Director of Engineering Tools at Netflix ○ Technical Leadership from wherever you are
  • 8. Quote from James Gosling...
  • 9. Highlights Too many great sessions to summarize them all, we have to extract a few recurring themes… ○ Distributed Application Design and Development ○ Big Data/Fast Data ○ Types and Safe Scala ○ Performance and Scalability
  • 10. Distributed Applications ● Life Beyond the Illusion of Present ● Reactive Reference Architectures ● Akka in Production: Why and How ● Easy Scalability with Akka ● Scalable task distribution with Scala, Akka and Mesos ● A Guided Tour of a Distributed Application
  • 11. Performance and Scalability ● Scala Collections and Performance ● Shattering Hadoop’s Large-Scala Sort Record with Spark and Scala ● Type-safe off-heap memory for Scala ● Akka in Production: Why and How ● Easy Scalability with Akka ● The JVM Backend and Optimizer in Scala 2.12
  • 12. Big Data, Fast Data ● Shattering Hadoop’s Large Scala Sort Record with Spark and Scala ● Scala - The Real Spark of Data Science ● Apache Spark: A Large Community Project in Scala ● S3 at Scala: Async Scala Client with Play Iteratees and Composable Operations ● The Unreasonable Effectiveness of Scala for Big Data ● Scalable task distribution with scala, Akka and Mesos
  • 13. Types and Safer Scala ● Keynote: Scala - where it came from, where it’s going ● Towards a Safer Scala ● Leveraging Scala Macros for Better Validation ● Type-level programming in Scala 101 ● Improving Correctness with Types ● Happy Paths: Functional Constructs in the Wild ● The Scalactic Way ● Delimited dependency-typed monadic checked exceptions
  • 14. The Rest... Many excellent talks were outside these categories ● Why Scala.js ● Reactive Slick for Database Programming ● Exercise in machine learning ● Functional Natural Language Processing ● If I Only Had a Brain...in Scala ● Akka HTTP: the Reactive Web Toolkit ● many many others
  • 15. Highlights of Specific Sessions A quick taster of what was in some of the more popular sessions...
  • 16. Scala - Where it came from, where it’s going
  • 17. Where it’s from, where it’s going “Scala is a gateway drug to Haskell” (in actual fact it’s going well beyond Haskell.) Slides: http://www.slideshare.net/Odersky/scala-days-san-francisco-45917092 Came from a practical combination of OOP and functional programming - Funny story about hipster syntax (..) instead of [..], <..> instead of [..], ??? instead of <..> - Trend in Type Systems - Scala JS is no longer experimental - TASTY: new scala-specific platform - Introduction to DOT - Type Parameters - Better treatment of effects with implicit Functions instead of Monads
  • 18. TASTY Scala faces challenges: ● binary compatibility ● having to pick a platform: JDK( 7,8,9,10, ?) or Javascript. Proposing a scala-specific platform called TASTY, (serialized typed abstract syntax tree), as an intermediate representation before bytecode - carries metadata of types, can be compiled with different versions of JDK, and to Javascript.
  • 19. Tasty will enable: ● instrumentation ● optimization ● code analysis ● refactoring ● publish once run anywhere ● automated remapping to solve binary compatibility issues.
  • 21. Explorations: Hope to find something cooler than Monads to handle effects. ● Monads don’t commute ● Require Monad transformers for composition ● Monad transformers make Martin’s head explode
  • 22. Toward a Safer Scala Leif Wickland http://tinyurl.com/sd15lint ● Scalac enables some error-prone code. ○ head of empty List? ● Using Static Analysis to detect errors early ● IDE based solutions ○ Inconsistencies ○ If not in release build process, doesn’t exist ● Web-based analysis ○ outside of compile loop ○ relatively immature analysis
  • 24. ● Scala Style ● Wart Remover ● Linter ● Watch ○ Abide ○ Scapegoat ○ Supersafe
  • 25. Life Beyond the Illusion of Present Jonas Bonér: The idea of the present is an illusion. Everything we see, hear and feel is just an echo from the past. But this illusion has influenced us and the way we view the world in so many ways. There is no present, all we have is facts derived from the merging of multiple pasts. The truth is closer to Einstein’s physics where everything is relative to one’s perspective. As developers we need to wake up and break free from the perceived reality of living in a single globally consistent present.
  • 26. The advent of multicore and cloud computing architectures meant that most applications today are distributed systems—multiple cores separated by the memory bus or multiple nodes separated by the network—which puts a harsh end to this illusion. The only way to design truly scalable and performant systems that can construct a sufficiently consistent view of history—and thereby our local “present”—is by treating time as a first class construct in our programming model and to model the present as facts derived from the merging of multiple concurrent pasts.
  • 27. How do we deal with failure and communication unreliability in real life? Confirmation and repetition We can’t force the world into a globally consistent present (CRUD). Mentioned 2 paradigms/theories: ● CALM (consistency as logical monotonicity) ● CRDT (Commutative Replicated Data Type) CRDT (Commutative Replicated Data Type) eventually consistent data types ● minimize contention / coordination in a distributed system. ● set, maps, graphs: rich data types. ● monotonic merge function: all state change is monotonically increasing, no way back.
  • 28. Improving Correctness with Types http://workday.github.io
  • 29. ● Using Wrapper Types (aka Tiny Types) instead of primitives ● Never use null, or throw Exceptions ● use === org.scalactic.TypeCheckedTripleEquals ○ requires the types of the two values compared to be in a subtype/supertype ● Never Use Non-Empty Lists when a list must be populated (org.scalactic.Every) ● Use Type Tags (ala Shapeless, Scalaz) ● Use Path Dependent Types ● Other reading ○ Self recursive types ○ Phantom Types ○ Shapeless ○ Scalactic Types: Defensive Programming. Fail Fast. Design By Contract.
  • 30. Function Passing Style Heather Miller: ● A new programming model called function passing designed to overcome many of imperative / weakly-typed issues found in traditional “big data” processing systems. ● Provides a more principled substrate on which to build data-centric distributed systems. ● Pass safe, well-typed serializable functions to immutable distributed data ● Based on her work on Pickling and Spores ● Uses Spores (Serializable Functions) for a distributed model. ● Kind of an Inverse of the Actor Model ● Stateless. data is stationary, functions are passed around. ● Uses Data Silos accessed through a Silo Ref.
  • 31. The Unreasonable Effectiveness of Scala for Big Data Dean Wampler ● How Hadoop Works - Map Reduce ○ Problems ■ Hard to implement algorithms ■ The Hadoop API is horrible ● Scalding ○ An improved Hadoop API in Scala ○ Problems ■ Still uses a batch mode ● Spark ○ An elegant, functional API ○ Still in Batch Mode, but with mini batches which approach real time.
  • 32. Akka HTTP: The Reactive Web Toolkit Roland Kuhn ● Replaces Spray ● Uses Akka Streams ○ Sources emit values to the stream ○ Sinks receive values, act on them ○ Sources can compose using Zip and Graph shapes ● “The pinball interpreter” ○ produce data ○ move downstream through transformations ○ get to the effect ○ go up and ask for more data ○ Filters interrupt the flow before getting to the effect, make the pinball go back upstream. ● A live coded demonstration of using Streams and Http ● Expected timeline for Streams - 4 weeks ● Expected timeline for Http - 8 weeks
  • 33. The Scalactic Way Bill Venners http://www.slideshare.net/bvenners/the-scalactic-way ScalaTest: quality through tests Scalactic: quality through types SuperSafe: quality through static analysis
  • 34.
  • 35.
  • 36. Reactive Slick for Database Programming Stefan Zeiger http://slick.typesafe.com/talks/scaladays2015sf/Reactive_Slick_for_Database_Programming.pdf Slick 3.0 ● JDBC is inherently blocking (and blocking ties up threads) ● Traditional Model ○ Fully synchronous ○ One thread per web request ○ Contention for Connections (getConnection blocks) ○ Database back-pressure creates more blocked threads ○ Doesn’t scale
  • 37. New Slick Architecture makes use of a new DataType to provide Asynchronous Database I/O ● based on State, IO and Free Monads. ● Returns a Future[R] ● Creates a separate ExecutionContext, avoiding blocking of current thread ● Works with akka-streams to create back pressure, so DB only gives as much data as client can process. ● For performance purposes it pre-fetches some data to keep client busy while it waits for the next portion from DB. sealed trait DBIOAction[+R, +S <: NoStream, -E <: Effect]{ def map[R2](f: R => R2)(implicit executor: ExecutionContext): DBIOAction[R2, NoStream, E] def flatMap[R2, S2 <: NoStream, E2 <: Effect](f: R => DBIOAction[R2, S2, E2])(implicit executor: ExecutionContext): DBIOAction[R2, S2, E with E2] ... }
  • 39. Easy Scalability with Akka Michael Nash ● Reviewed Akka, CQRS, ES ● Introduced Distributed DDD ● Identical clustered system with DDDD and Without ● Gatling performance tests on both
  • 40. ConductR ● Application manager that empowers ops to deploy distributed systems ● Uses Akka, Play, Aka Streams, Akka Cluster, FSM, Akka Data Replication ● How can we run cluster based apps ensuring the seed nodes are started first? ○ State replicated using Data Replication ● How can we consolidate logging? ○ Using Akka Streams ● How can we avoid batching? ○ Use Event Driven Architecture ● How can monitor/test multiple nodes? ○ Use the visualizer built into conductor ● How can we share state among the nodes? ○ Use Akka Data Replication
  • 41. Scala.js Building a data-driven map of the world in 10 minutes….
  • 42. Whats wrong with Webapps? ● Everything String/Map[String, String] ● Compiler cannot help you! ○ document.getElementByld("my-id") ● Javascript! ○ ["10", "10", "10", "10"].map(parseInt) [10, NaN, 2, 3] // WTF ScalaJS ● lets you write webapp in one language ● Swap String-typing for Strong-typing ● Type Everything!! ○ val res: Future[Seq[String]] = Ajax[Api].list(inputBox.value).call() ● IS NOT JAVASCRIPT ○ scala.js> List("10", "10", "10", "10").map(parseInt) List(10, 10, 10, 10) // Yay!
  • 43. The BoldRadius Crew Packing up...
  • 45. ScalaDays Amsterdam! ● June 8th to 10th ● Followed by Training