From Hiroshima, living in Tokyo for 16+ years - A Scala enthusiast since 2011 - OSS: ScalikeJDBC, Skinny, Scalatra, json4s, etc - Organizer of Scala meetups (inactive now) - Software Engineer / Engineering Manager at SmartNews (2016 - ) - Java/Kotlin/Scala for back-end APIs - Software Engineer at M3 (2009 - 2016) - Java/Scala for back-end APIs - Ruby on Rails for front-end web app
the lead) - Surprised the industry by “Twitter on Scala (2009)” - LinkedIn (Lightbend case study) - Tumblr (Colossus, Talk at Scala by the Bay 2016) - Netflix (Netfix Scala OSS List) - Credit Karma (Lightbend case study) - The Guardian (Lightbend case study) - What startups or tech companies are using Scala? (Quora)
implementation of actor model on the JVM - akka-streams: Reactive Streams implementation built upon Akka - akka-http: Full server/client HTTP stack - Play Framework (playframework.com) - Play 1: a “Java on Rails” (built in Java) - Play 2: Framework to build non-blocking HTTP services - Built upon akka-http (formerly, Netty)
- Finagle: A Protocol-Agnostic RPC System - “an extensible RPC system for the JVM” - Standardized the concept of Future API before others - HTTP/Thrift server toolkit - The basis of huge backend at Twitter - Twitter Server - Finatra - Finch
Type-safety (statically-typed) - Expressiveness (object-oriented + functional) - Concurrency support (Future API) - Akka’s Actor Model - Finagle from Twitter - In particular, I like ... - Type-safety (statically-typed) - Expressiveness (object-oriented + functional)
Building and operating small/medium scale web apps - Non-blocking is not required - Dealing with real world data / legacy APIs - Maintainability for long living systems - Compile time checks - Making code well-documented with static types - Keeping it easy-to-understand for anybody - Never enforce users efforts when upgrading
pages - Validation rule DSL - easy-to-understand & extendable - O/R mapper - built upon ScalikeJDBC - Database migration - using Flyway - Template engine -Scalate by default - Mail module - built upon JavaMail - OAuth integration (Facebook, Google, Twitter, GitHub, etc) - Unit testing support - with embedded Jetty HTTP server
{ val paramsToSave = params.permit(strongParams: _*) val id = Task.createWithStrongParameters(paramsToSave) redirect(s“/tasks/${id}”) } else { status = 400 render(“/tasks/new”) // Error messages are already bound in the view } }
the idiomatic way - Rails is a collection of idioms in Web development - No need to worry about the design of basic concepts - (2) Some people don’t prefer the Rails way like “Omakase” - Allowing work around for corner cases - Difficult to change people’s preferences - (3) Decided to have several differences from Ruby on Rails - Don’t use instance fields to pass values to view templates - Separated validations from models - Don’t support routes.rb (mainly due to maintenance costs)
dynamic resolutions of associations - Good Point: By design, it’s hard to issue N+1 queries - Bad Point: Not so handy for quick-prototyping - (2) Immutable data structure vs Datastore in the wild - Rows in database table are mutable - auto_generated PK field - Long or Option[Long] (= can be null/nil) - Decided not to support insertion with an entity (so far)
(+ Actor model) - 2017: Reactive - Turning points in the history - 2012/12: Scala 2.10.0 with Future APIs - 2013/8: I started the Skinny project - 2014/3: Skinny 1.0.0 - 2016/3: Typesafe was renamed to Lightbend - Symbolic decision: Reactiveness > Type-safety
No extra costs without benefits - Except for compatibility with Rails API (renaming, etc) - Servlet, JDBC have never introduced breaking changes - Placing an importance on the trust - The trust should be a unique value in Scala - To be chosen again for next project at ease
but need a good ORM!” - Steep learning curve for other libraries - Skinny ORM is widely accepted in non-Skinny projects - Keep being portable and flexible - So few dependencies (a JDBC driver, slf4j-api, joda-time) - No magic, simply built upon JDBC drivers
expressiveness - Rails = a collection of idioms in Web app development - Making a yet another Rails = a lot of fun! - “Skinny” was named after a RubyKaigi talk - Be aware of the moving trends