SlideShare una empresa de Scribd logo
1 de 69
Descargar para leer sin conexión
Scala in a wild
enterprise
Rafael Bagmanov
( Grid Dynamics )
the?
In what use cases (types of applications)
does Scala make the least sense?
"Database front end, CRUD apps.
Most of the boring apps that are built with
Struts and Spring"
David Pollak
"Barriers to scala adoption" Infoq.com
OpenGenesis
github.com/griddynamics/OpenGenesis
● open source - open-genesis.org
● 2 years of development
● > 50 KLOC of scala code
● successfully deployed to production in one
large american financial institution
● Buzzwords: continuous deployment, cloud,
chef, devops, aws, openstack
OpenGenesis
Deployment orchestration tool
● Integration with legacy apps and data (lots of
SOAP and xml)
● sophisticated security policies
● IT department separated from development
team
● J2EE Containers everywhere
● Risk averse
Enterprise characteristics
Typical "lightweight" j2ee stack
Web layer
Service layer
Data access layer
DB
Spring MVC
Spring
JPA
j2ee stack. Scala edition
Web layer
Service layer
Data access layer
DB
Spring MVC + scala magic
Spring + scala implicits
JPA Squeryl
j2ee stack. Scala edition
Web layer
Service layer
Data access layer
DB
Spring MVC
Spring
Squeryl
WAR
j2ee stack. Scala edition + scala
goodness
Web layer
Service layer
Data access layer
DB
Spring MVC
Spring
Squeryl
Workflow distributed
engine
Akka
WAR
Service layer: Spring
● DI fits almost nicely with scala
Spring with scala
● DI fits almost nicely with scala
class GenesisRestController {
@Autowired var genesisService: GenesisService = _
}
class GenesisRestController {
@BeanProperty var genesisService: GenesisService = _
}
class GenesisRestController (genesisService: GenesisService) {}
Spring with scala
● DI fits almost nicely with scala
○ "Everything is a trait" approach can't be done
Spring with scala
● DI fits almost nicely with scala
○ "Everything is a trait" approach can't be done
○ Be aware of type inference in @Configuration bean
trait Service
class ServiceImpl extends Service
@Configuration
class ServiceContext {
@Bean def service = new ServiceImpl
}
Spring with scala
● DI fits almost nicely with scala
○ "Everything is a trait" approach can't be done
○ Be aware of type inference in @Configuration bean
trait Service
class ServiceImpl extends Service
@Configuration
class ServiceContext {
@Bean def service: Service = new ServiceImpl
}
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
springLdapTemplate.authenticate("user", "*", "password", new
AuthenticationErrorCallback {
def execute(e: Exception) {log.error(e)}
})
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
springLdapTemplate.authenticate("user", "*", "password", new
AuthenticationErrorCallback {
def execute(e: Exception) {log.error(e)}
})
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
springLdapTemplate.authenticate("user", "*", "password", new
AuthenticationErrorCallback {
def execute(e: Exception) {log.error(e)}
})
springLdapTemplate.authenticate("user", "*", "password", log.error(_))
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
springLdapTemplate.authenticate("user", "*", "password", log.error(_))
implicit def authErrorCallbackWrapper(func:(Exception) => Any) = {
new AuthenticationErrorCallback {
def execute(exception: Exception): Unit = func(exception)
}
}
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
● AOP for free (almost)
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
● AOP for free (almost)
○ Be aware of naming in debug info
def findUsers(projectId: Int) {
dao.findUsers(projectId)
}
def findUsers2(projectId: Int) {
dao.allUsers().filter(_.projectId == projectId)
}
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
● AOP for free (almost)
○ Be aware of naming in debug info
def findUsers(projectId: Int) { // debugIfo: name "projectId"
dao.findUsers(projectId)
}
def findUsers2(projectId: Int) { // debugInfo: name "projectId$"
dao.allUsers().filter(_.projectId == projectId)
}
Spring with scala
● DI fits almost nicely with scala
● Rich spring templates libraries.
● AOP for free (almost)
● Spring security just works
Spring with scala
Persistence layer: Squeryl
● Lightweight ORM written in scala
Squeryl
● Lightweight ORM written in scala
Squeryl
class Workflow(override val id: Int) extends KeyedEntity[Int]
● Lightweight ORM written in scala
Squeryl
class Workflow(override val id: Int) extends KeyedEntity[Int]
object GS extends Schema {
val workflows = table[Workflow]
}
● Lightweight ORM written in scala
Squeryl
class Workflow(override val id: Int) extends KeyedEntity[Int]
object GS extends Schema {
val workflows = table[Workflow]
}
def find(workflowId: Int) = from(GS.workflows)(w =>
where(w.id === workflowId)
select (w)
orderBy(w.id desc)
)
● Lightweight ORM written in scala
○ First class support for scala collections, options, etc
Squeryl
● Lightweight ORM written in scala
○ First class support for scala collections, options, etc
○ Integrates with spring transaction management
(not out of the box)
Squeryl
● Lightweight ORM written in scala
○ First class support for scala collections, options, etc
○ Integrates with spring transaction management
(not out of the box)
Squeryl
@Transactional(propagation = REQUIRES_NEW)
def find(workflowId: Int) = from(GS.workflows)(w =>
where(w.id === workflowId)
select (w)
orderBy(w.id desc)
)
Squeryl
● Lightweight ORM written in scala
○ Likes heap in the same proportion as
Hibernate does
hibernate squeryl
● Lightweight ORM written in scala
○ Likes heap in the same proportion as
Hibernate does
○ Lot's of "black magic" in source code
Squeryl
● Lightweight ORM written in scala
● Internal scala DSL for writing queries
○ Type safe queries - compile time syntax check
Squeryl
● Lightweight ORM written in scala
● Internal scala DSL for writing queries
○ Lot's of "black magic" in source code
Squeryl
● Lightweight ORM written in scala
● Internal scala DSL for writing queries
○ Lot's of "black magic" in source code
○ Fallback on native sql is not easy
Squeryl
● Lightweight ORM written in scala
● Internal scala DSL for writing queries
○ Lot's of "black magic" in source code
○ Fallback on native sql is not easy
○ Lots of implicits drives IDE crazy and
increases compilation time
Squeryl
● Lightweight ORM written in scala
● Internal scala DSL for writing queries
○ Lot's of "black magic" in source code
○ Fallback on native sql is not easy
○ Lots of implicits drives IDE crazy and
increase compilation time
○ The approach is somewhat flawed (opinion)
Squeryl
Web layer: Spring MVC
lift-json
scala magic
● RESTfull web services
Web layer
case class User (
@NotBlank username: String,
@Email @Size(min = 1, max = 256) email: String,
password: Option[String]
)
@Controller
@RequestMapping(Array("/rest/users"))
class UsersController {
@RequestMapping(method = Array(RequestMethod.POST))
@ResponseBody
def create(@RequestBody @Valid request: User): User = userService.create(request)
}
● RESTfull web services
● Easy to make Hypermedia REST with
implicits
Web layer
@Controller
@RequestMapping(Array("/rest/users"))
class UsersController {
import com.griddynamics.genesis.rest.links.Hypermedia._
@RequestMapping(method = Array(RequestMethod.POST))
@ResponseBody
def create(@RequestBody @Valid request: User): Hypermedia[User] = {
userService.create(request).withLink("/rest/users", LinkType.SELF)
}
Couple of words about
AKKA
Ехал Акка через Акка
Смотрит Акка в Акка Акка
Сунул Акка Акка в Акка
Акка Акка Акка Акка *
* Ode to Akka in russian
Greatest challenge:
Greatest challenge:
People
● Hiring is hard
Challenges
● Hiring is hard
○ Scala is a talent attraction
Challenges
● Hiring is hard
○ Scala is a talent attraction
○ In avg: 0.5 interview per month
Challenges
● Hiring is hard
● Settling team standards and code
convention
Challenges
● Hiring is hard
● Settling team standards and code
convention
○ Tools are not there yet
Challenges
● Hiring is hard
● Settling team standards and code
convention
○ Tools are not there yet
○ Between "OCaml" and "Java" fires
Challenges
● Hiring is hard
● Settling team standards and code
convention
○ Tools are not there yet
○ Between "OCaml" and "Java" fires
○ "Effective scala" by Twitter and "Scala style guide"
might help (a bit)
Challenges
The greatest code-review mystery of
all times
if (option.isDefined) {
..
}
option.foreach { .. }
option match {
case Some(x) => ..
case None => ..
}
How to deal with scala.Option
?
The greatest code-review mystery of
all times
if (option.isDefined) {
..
}
option.foreach { .. }
option match {
case Some(x) => ..
case None => ..
}
How to deal with scala.Option
?
Recruiting java
developers
aka
5 stages of grief
1. Denial
2. Anger
3. Bargaining
4. Depression
5. Acceptance
5 stages of grief
1. Denial
2. Anger
3. Bargaining
4. Depression
5. Acceptance
5 stages of grief
1. Denial
2. Anger
3. Bargaining
4. Depression
5. Acceptance
5 stages of grief
1. Denial
2. Anger
3. Bargaining
4. Depression
5. Acceptance
5 stages of grief
1. Denial
2. Anger
3. Bargaining
4. Depression
5. Acceptance
5 stages of grief
1. Denial
2. Anger
3. Bargaining
4. Depression
5. Acceptance
5 stages of grief
Enterprise Scala adoption challenges

Más contenido relacionado

La actualidad más candente

JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]Leonardo De Moura Rocha Lima
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaScala Italy
 
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...scalaconfjp
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to ScalaSaleem Ansari
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaWO Community
 
Advanced Production Debugging
Advanced Production DebuggingAdvanced Production Debugging
Advanced Production DebuggingTakipi
 
Type-safe front-end development with Scala
Type-safe front-end development with ScalaType-safe front-end development with Scala
Type-safe front-end development with Scalatakezoe
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were PossibleLukas Eder
 
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Codemotion
 
Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuSalesforce Developers
 
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一scalaconfjp
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論scalaconfjp
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San FranciscoMartin Odersky
 
Collections.compare(JDK, Eclipse, Guava, Apache...);
Collections.compare(JDK, Eclipse, Guava, Apache...);Collections.compare(JDK, Eclipse, Guava, Apache...);
Collections.compare(JDK, Eclipse, Guava, Apache...);Leonardo De Moura Rocha Lima
 
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and AngularScal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and AngularKnoldus Inc.
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Rightmircodotta
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinayViplav Jain
 

La actualidad más candente (20)

JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of Scala
 
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
 
Scala for C# Developers
Scala for C# DevelopersScala for C# Developers
Scala for C# Developers
 
Advanced Production Debugging
Advanced Production DebuggingAdvanced Production Debugging
Advanced Production Debugging
 
Type-safe front-end development with Scala
Type-safe front-end development with ScalaType-safe front-end development with Scala
Type-safe front-end development with Scala
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible
 
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
 
Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and Heroku
 
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Collections.compare(JDK, Eclipse, Guava, Apache...);
Collections.compare(JDK, Eclipse, Guava, Apache...);Collections.compare(JDK, Eclipse, Guava, Apache...);
Collections.compare(JDK, Eclipse, Guava, Apache...);
 
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and AngularScal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and Angular
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
 

Similar a Enterprise Scala adoption challenges

Scala Frustrations
Scala FrustrationsScala Frustrations
Scala Frustrationstakezoe
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistpmanvi
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Codemotion
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSAlberto Paro
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMarakana Inc.
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scalascalaconfjp
 
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 OderskySpark Summit
 
Scaling Up Machine Learning Experimentation at Tubi 5x and Beyond
Scaling Up Machine Learning Experimentation at Tubi 5x and BeyondScaling Up Machine Learning Experimentation at Tubi 5x and Beyond
Scaling Up Machine Learning Experimentation at Tubi 5x and BeyondScyllaDB
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffJAX London
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Michael Rys
 
Scala - from "Hello, World" to "Heroku Scale"
Scala - from "Hello, World" to "Heroku Scale"Scala - from "Hello, World" to "Heroku Scale"
Scala - from "Hello, World" to "Heroku Scale"Salesforce Developers
 
Scala,a practicle approach
Scala,a practicle approachScala,a practicle approach
Scala,a practicle approachDeepak Kumar
 
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKazuhiro Sera
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbMongoDB APAC
 
Cascalog at Strange Loop
Cascalog at Strange LoopCascalog at Strange Loop
Cascalog at Strange Loopnathanmarz
 
Building DSLs with Scala
Building DSLs with ScalaBuilding DSLs with Scala
Building DSLs with ScalaMohit Jaggi
 
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGNIntroducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGNManish Pandit
 

Similar a Enterprise Scala adoption challenges (20)

Scala Frustrations
Scala FrustrationsScala Frustrations
Scala Frustrations
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJS
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
 
Scala and Spring
Scala and SpringScala and Spring
Scala and Spring
 
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
 
Devoxx
DevoxxDevoxx
Devoxx
 
Scaling Up Machine Learning Experimentation at Tubi 5x and Beyond
Scaling Up Machine Learning Experimentation at Tubi 5x and BeyondScaling Up Machine Learning Experimentation at Tubi 5x and Beyond
Scaling Up Machine Learning Experimentation at Tubi 5x and Beyond
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)
 
Scala - from "Hello, World" to "Heroku Scale"
Scala - from "Hello, World" to "Heroku Scale"Scala - from "Hello, World" to "Heroku Scale"
Scala - from "Hello, World" to "Heroku Scale"
 
Scala,a practicle approach
Scala,a practicle approachScala,a practicle approach
Scala,a practicle approach
 
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
 
Scala active record
Scala active recordScala active record
Scala active record
 
Cascalog at Strange Loop
Cascalog at Strange LoopCascalog at Strange Loop
Cascalog at Strange Loop
 
Building DSLs with Scala
Building DSLs with ScalaBuilding DSLs with Scala
Building DSLs with Scala
 
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGNIntroducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
 

Más de e-Legion

MBLT16: Elena Rydkina, Pure
MBLT16: Elena Rydkina, PureMBLT16: Elena Rydkina, Pure
MBLT16: Elena Rydkina, Puree-Legion
 
MBLT16: Alexander Lukin, AppMetrica
MBLT16: Alexander Lukin, AppMetricaMBLT16: Alexander Lukin, AppMetrica
MBLT16: Alexander Lukin, AppMetricae-Legion
 
MBLT16: Vincent Wu, Alibaba Mobile
MBLT16: Vincent Wu, Alibaba MobileMBLT16: Vincent Wu, Alibaba Mobile
MBLT16: Vincent Wu, Alibaba Mobilee-Legion
 
MBLT16: Dmitriy Geranin, Afisha Restorany
MBLT16: Dmitriy Geranin, Afisha RestoranyMBLT16: Dmitriy Geranin, Afisha Restorany
MBLT16: Dmitriy Geranin, Afisha Restoranye-Legion
 
MBLT16: Marvin Liao, 500Startups
MBLT16: Marvin Liao, 500StartupsMBLT16: Marvin Liao, 500Startups
MBLT16: Marvin Liao, 500Startupse-Legion
 
MBLT16: Andrey Maslak, Aviasales
MBLT16: Andrey Maslak, AviasalesMBLT16: Andrey Maslak, Aviasales
MBLT16: Andrey Maslak, Aviasalese-Legion
 
MBLT16: Andrey Bakalenko, Sberbank Online
MBLT16: Andrey Bakalenko, Sberbank OnlineMBLT16: Andrey Bakalenko, Sberbank Online
MBLT16: Andrey Bakalenko, Sberbank Onlinee-Legion
 
Rx Java architecture
Rx Java architectureRx Java architecture
Rx Java architecturee-Legion
 
MBLTDev15: Hector Zarate, Spotify
MBLTDev15: Hector Zarate, SpotifyMBLTDev15: Hector Zarate, Spotify
MBLTDev15: Hector Zarate, Spotifye-Legion
 
MBLTDev15: Cesar Valiente, Wunderlist
MBLTDev15: Cesar Valiente, WunderlistMBLTDev15: Cesar Valiente, Wunderlist
MBLTDev15: Cesar Valiente, Wunderliste-Legion
 
MBLTDev15: Brigit Lyons, Soundcloud
MBLTDev15: Brigit Lyons, SoundcloudMBLTDev15: Brigit Lyons, Soundcloud
MBLTDev15: Brigit Lyons, Soundcloude-Legion
 
MBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&CoMBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&Coe-Legion
 
MBLTDev15: Alexander Orlov, Postforpost
MBLTDev15: Alexander Orlov, PostforpostMBLTDev15: Alexander Orlov, Postforpost
MBLTDev15: Alexander Orlov, Postforposte-Legion
 
MBLTDev15: Artemiy Sobolev, Parallels
MBLTDev15: Artemiy Sobolev, ParallelsMBLTDev15: Artemiy Sobolev, Parallels
MBLTDev15: Artemiy Sobolev, Parallelse-Legion
 
MBLTDev15: Alexander Dimchenko, DIT
MBLTDev15: Alexander Dimchenko, DITMBLTDev15: Alexander Dimchenko, DIT
MBLTDev15: Alexander Dimchenko, DITe-Legion
 
MBLTDev: Evgeny Lisovsky, Litres
MBLTDev: Evgeny Lisovsky, LitresMBLTDev: Evgeny Lisovsky, Litres
MBLTDev: Evgeny Lisovsky, Litrese-Legion
 
MBLTDev: Alexander Dimchenko, Bright Box
MBLTDev: Alexander Dimchenko, Bright Box MBLTDev: Alexander Dimchenko, Bright Box
MBLTDev: Alexander Dimchenko, Bright Box e-Legion
 
MBLTDev15: Konstantin Goldshtein, Microsoft
MBLTDev15: Konstantin Goldshtein, MicrosoftMBLTDev15: Konstantin Goldshtein, Microsoft
MBLTDev15: Konstantin Goldshtein, Microsofte-Legion
 
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank e-Legion
 

Más de e-Legion (20)

MBLT16: Elena Rydkina, Pure
MBLT16: Elena Rydkina, PureMBLT16: Elena Rydkina, Pure
MBLT16: Elena Rydkina, Pure
 
MBLT16: Alexander Lukin, AppMetrica
MBLT16: Alexander Lukin, AppMetricaMBLT16: Alexander Lukin, AppMetrica
MBLT16: Alexander Lukin, AppMetrica
 
MBLT16: Vincent Wu, Alibaba Mobile
MBLT16: Vincent Wu, Alibaba MobileMBLT16: Vincent Wu, Alibaba Mobile
MBLT16: Vincent Wu, Alibaba Mobile
 
MBLT16: Dmitriy Geranin, Afisha Restorany
MBLT16: Dmitriy Geranin, Afisha RestoranyMBLT16: Dmitriy Geranin, Afisha Restorany
MBLT16: Dmitriy Geranin, Afisha Restorany
 
MBLT16: Marvin Liao, 500Startups
MBLT16: Marvin Liao, 500StartupsMBLT16: Marvin Liao, 500Startups
MBLT16: Marvin Liao, 500Startups
 
MBLT16: Andrey Maslak, Aviasales
MBLT16: Andrey Maslak, AviasalesMBLT16: Andrey Maslak, Aviasales
MBLT16: Andrey Maslak, Aviasales
 
MBLT16: Andrey Bakalenko, Sberbank Online
MBLT16: Andrey Bakalenko, Sberbank OnlineMBLT16: Andrey Bakalenko, Sberbank Online
MBLT16: Andrey Bakalenko, Sberbank Online
 
Rx Java architecture
Rx Java architectureRx Java architecture
Rx Java architecture
 
Rx java
Rx javaRx java
Rx java
 
MBLTDev15: Hector Zarate, Spotify
MBLTDev15: Hector Zarate, SpotifyMBLTDev15: Hector Zarate, Spotify
MBLTDev15: Hector Zarate, Spotify
 
MBLTDev15: Cesar Valiente, Wunderlist
MBLTDev15: Cesar Valiente, WunderlistMBLTDev15: Cesar Valiente, Wunderlist
MBLTDev15: Cesar Valiente, Wunderlist
 
MBLTDev15: Brigit Lyons, Soundcloud
MBLTDev15: Brigit Lyons, SoundcloudMBLTDev15: Brigit Lyons, Soundcloud
MBLTDev15: Brigit Lyons, Soundcloud
 
MBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&CoMBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&Co
 
MBLTDev15: Alexander Orlov, Postforpost
MBLTDev15: Alexander Orlov, PostforpostMBLTDev15: Alexander Orlov, Postforpost
MBLTDev15: Alexander Orlov, Postforpost
 
MBLTDev15: Artemiy Sobolev, Parallels
MBLTDev15: Artemiy Sobolev, ParallelsMBLTDev15: Artemiy Sobolev, Parallels
MBLTDev15: Artemiy Sobolev, Parallels
 
MBLTDev15: Alexander Dimchenko, DIT
MBLTDev15: Alexander Dimchenko, DITMBLTDev15: Alexander Dimchenko, DIT
MBLTDev15: Alexander Dimchenko, DIT
 
MBLTDev: Evgeny Lisovsky, Litres
MBLTDev: Evgeny Lisovsky, LitresMBLTDev: Evgeny Lisovsky, Litres
MBLTDev: Evgeny Lisovsky, Litres
 
MBLTDev: Alexander Dimchenko, Bright Box
MBLTDev: Alexander Dimchenko, Bright Box MBLTDev: Alexander Dimchenko, Bright Box
MBLTDev: Alexander Dimchenko, Bright Box
 
MBLTDev15: Konstantin Goldshtein, Microsoft
MBLTDev15: Konstantin Goldshtein, MicrosoftMBLTDev15: Konstantin Goldshtein, Microsoft
MBLTDev15: Konstantin Goldshtein, Microsoft
 
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

Enterprise Scala adoption challenges

  • 1.
  • 2.
  • 3. Scala in a wild enterprise Rafael Bagmanov ( Grid Dynamics ) the?
  • 4. In what use cases (types of applications) does Scala make the least sense?
  • 5. "Database front end, CRUD apps. Most of the boring apps that are built with Struts and Spring" David Pollak "Barriers to scala adoption" Infoq.com
  • 6.
  • 8. ● open source - open-genesis.org ● 2 years of development ● > 50 KLOC of scala code ● successfully deployed to production in one large american financial institution ● Buzzwords: continuous deployment, cloud, chef, devops, aws, openstack OpenGenesis Deployment orchestration tool
  • 9. ● Integration with legacy apps and data (lots of SOAP and xml) ● sophisticated security policies ● IT department separated from development team ● J2EE Containers everywhere ● Risk averse Enterprise characteristics
  • 10. Typical "lightweight" j2ee stack Web layer Service layer Data access layer DB Spring MVC Spring JPA
  • 11. j2ee stack. Scala edition Web layer Service layer Data access layer DB Spring MVC + scala magic Spring + scala implicits JPA Squeryl
  • 12. j2ee stack. Scala edition Web layer Service layer Data access layer DB Spring MVC Spring Squeryl WAR
  • 13. j2ee stack. Scala edition + scala goodness Web layer Service layer Data access layer DB Spring MVC Spring Squeryl Workflow distributed engine Akka WAR
  • 15. ● DI fits almost nicely with scala Spring with scala
  • 16. ● DI fits almost nicely with scala class GenesisRestController { @Autowired var genesisService: GenesisService = _ } class GenesisRestController { @BeanProperty var genesisService: GenesisService = _ } class GenesisRestController (genesisService: GenesisService) {} Spring with scala
  • 17. ● DI fits almost nicely with scala ○ "Everything is a trait" approach can't be done Spring with scala
  • 18. ● DI fits almost nicely with scala ○ "Everything is a trait" approach can't be done ○ Be aware of type inference in @Configuration bean trait Service class ServiceImpl extends Service @Configuration class ServiceContext { @Bean def service = new ServiceImpl } Spring with scala
  • 19. ● DI fits almost nicely with scala ○ "Everything is a trait" approach can't be done ○ Be aware of type inference in @Configuration bean trait Service class ServiceImpl extends Service @Configuration class ServiceContext { @Bean def service: Service = new ServiceImpl } Spring with scala
  • 20. ● DI fits almost nicely with scala ● Rich spring templates libraries. Spring with scala
  • 21. ● DI fits almost nicely with scala ● Rich spring templates libraries. springLdapTemplate.authenticate("user", "*", "password", new AuthenticationErrorCallback { def execute(e: Exception) {log.error(e)} }) Spring with scala
  • 22. ● DI fits almost nicely with scala ● Rich spring templates libraries. springLdapTemplate.authenticate("user", "*", "password", new AuthenticationErrorCallback { def execute(e: Exception) {log.error(e)} }) Spring with scala
  • 23. ● DI fits almost nicely with scala ● Rich spring templates libraries. springLdapTemplate.authenticate("user", "*", "password", new AuthenticationErrorCallback { def execute(e: Exception) {log.error(e)} }) springLdapTemplate.authenticate("user", "*", "password", log.error(_)) Spring with scala
  • 24. ● DI fits almost nicely with scala ● Rich spring templates libraries. springLdapTemplate.authenticate("user", "*", "password", log.error(_)) implicit def authErrorCallbackWrapper(func:(Exception) => Any) = { new AuthenticationErrorCallback { def execute(exception: Exception): Unit = func(exception) } } Spring with scala
  • 25. ● DI fits almost nicely with scala ● Rich spring templates libraries. ● AOP for free (almost) Spring with scala
  • 26. ● DI fits almost nicely with scala ● Rich spring templates libraries. ● AOP for free (almost) ○ Be aware of naming in debug info def findUsers(projectId: Int) { dao.findUsers(projectId) } def findUsers2(projectId: Int) { dao.allUsers().filter(_.projectId == projectId) } Spring with scala
  • 27. ● DI fits almost nicely with scala ● Rich spring templates libraries. ● AOP for free (almost) ○ Be aware of naming in debug info def findUsers(projectId: Int) { // debugIfo: name "projectId" dao.findUsers(projectId) } def findUsers2(projectId: Int) { // debugInfo: name "projectId$" dao.allUsers().filter(_.projectId == projectId) } Spring with scala
  • 28. ● DI fits almost nicely with scala ● Rich spring templates libraries. ● AOP for free (almost) ● Spring security just works Spring with scala
  • 30. ● Lightweight ORM written in scala Squeryl
  • 31. ● Lightweight ORM written in scala Squeryl class Workflow(override val id: Int) extends KeyedEntity[Int]
  • 32. ● Lightweight ORM written in scala Squeryl class Workflow(override val id: Int) extends KeyedEntity[Int] object GS extends Schema { val workflows = table[Workflow] }
  • 33. ● Lightweight ORM written in scala Squeryl class Workflow(override val id: Int) extends KeyedEntity[Int] object GS extends Schema { val workflows = table[Workflow] } def find(workflowId: Int) = from(GS.workflows)(w => where(w.id === workflowId) select (w) orderBy(w.id desc) )
  • 34. ● Lightweight ORM written in scala ○ First class support for scala collections, options, etc Squeryl
  • 35. ● Lightweight ORM written in scala ○ First class support for scala collections, options, etc ○ Integrates with spring transaction management (not out of the box) Squeryl
  • 36. ● Lightweight ORM written in scala ○ First class support for scala collections, options, etc ○ Integrates with spring transaction management (not out of the box) Squeryl @Transactional(propagation = REQUIRES_NEW) def find(workflowId: Int) = from(GS.workflows)(w => where(w.id === workflowId) select (w) orderBy(w.id desc) )
  • 37. Squeryl ● Lightweight ORM written in scala ○ Likes heap in the same proportion as Hibernate does hibernate squeryl
  • 38. ● Lightweight ORM written in scala ○ Likes heap in the same proportion as Hibernate does ○ Lot's of "black magic" in source code Squeryl
  • 39. ● Lightweight ORM written in scala ● Internal scala DSL for writing queries ○ Type safe queries - compile time syntax check Squeryl
  • 40. ● Lightweight ORM written in scala ● Internal scala DSL for writing queries ○ Lot's of "black magic" in source code Squeryl
  • 41. ● Lightweight ORM written in scala ● Internal scala DSL for writing queries ○ Lot's of "black magic" in source code ○ Fallback on native sql is not easy Squeryl
  • 42. ● Lightweight ORM written in scala ● Internal scala DSL for writing queries ○ Lot's of "black magic" in source code ○ Fallback on native sql is not easy ○ Lots of implicits drives IDE crazy and increases compilation time Squeryl
  • 43. ● Lightweight ORM written in scala ● Internal scala DSL for writing queries ○ Lot's of "black magic" in source code ○ Fallback on native sql is not easy ○ Lots of implicits drives IDE crazy and increase compilation time ○ The approach is somewhat flawed (opinion) Squeryl
  • 44. Web layer: Spring MVC lift-json scala magic
  • 45. ● RESTfull web services Web layer case class User ( @NotBlank username: String, @Email @Size(min = 1, max = 256) email: String, password: Option[String] ) @Controller @RequestMapping(Array("/rest/users")) class UsersController { @RequestMapping(method = Array(RequestMethod.POST)) @ResponseBody def create(@RequestBody @Valid request: User): User = userService.create(request) }
  • 46. ● RESTfull web services ● Easy to make Hypermedia REST with implicits Web layer @Controller @RequestMapping(Array("/rest/users")) class UsersController { import com.griddynamics.genesis.rest.links.Hypermedia._ @RequestMapping(method = Array(RequestMethod.POST)) @ResponseBody def create(@RequestBody @Valid request: User): Hypermedia[User] = { userService.create(request).withLink("/rest/users", LinkType.SELF) }
  • 47. Couple of words about AKKA
  • 48. Ехал Акка через Акка Смотрит Акка в Акка Акка Сунул Акка Акка в Акка Акка Акка Акка Акка * * Ode to Akka in russian
  • 51. ● Hiring is hard Challenges
  • 52. ● Hiring is hard ○ Scala is a talent attraction Challenges
  • 53. ● Hiring is hard ○ Scala is a talent attraction ○ In avg: 0.5 interview per month Challenges
  • 54. ● Hiring is hard ● Settling team standards and code convention Challenges
  • 55. ● Hiring is hard ● Settling team standards and code convention ○ Tools are not there yet Challenges
  • 56. ● Hiring is hard ● Settling team standards and code convention ○ Tools are not there yet ○ Between "OCaml" and "Java" fires Challenges
  • 57. ● Hiring is hard ● Settling team standards and code convention ○ Tools are not there yet ○ Between "OCaml" and "Java" fires ○ "Effective scala" by Twitter and "Scala style guide" might help (a bit) Challenges
  • 58. The greatest code-review mystery of all times if (option.isDefined) { .. } option.foreach { .. } option match { case Some(x) => .. case None => .. } How to deal with scala.Option ?
  • 59. The greatest code-review mystery of all times if (option.isDefined) { .. } option.foreach { .. } option match { case Some(x) => .. case None => .. } How to deal with scala.Option ?
  • 61. aka
  • 62. 5 stages of grief
  • 63. 1. Denial 2. Anger 3. Bargaining 4. Depression 5. Acceptance 5 stages of grief
  • 64. 1. Denial 2. Anger 3. Bargaining 4. Depression 5. Acceptance 5 stages of grief
  • 65. 1. Denial 2. Anger 3. Bargaining 4. Depression 5. Acceptance 5 stages of grief
  • 66. 1. Denial 2. Anger 3. Bargaining 4. Depression 5. Acceptance 5 stages of grief
  • 67. 1. Denial 2. Anger 3. Bargaining 4. Depression 5. Acceptance 5 stages of grief
  • 68. 1. Denial 2. Anger 3. Bargaining 4. Depression 5. Acceptance 5 stages of grief