SlideShare a Scribd company logo
Scalable language;
   Scalable web
     Timothy Perrett
     ScalaDays 2012
Hello.
Hello.
Outline.
Scal•a•ble
Able to be used or produced in a range of
capabilities: it is scalable across a range of
                    systems.
Memory
 Lane.
package example.java.sucks;

import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;

public class HelloServlet extends HttpServlet {
  public void doGet (HttpServletRequest req,
                     HttpServletResponse res)
    throws ServletException, IOException
  {
    PrintWriter out = res.getWriter();
    out.println("Hello, world!");
    out.close();
  }
}
Vibrant Scala
 Ecosystem.
Scaling Down.
    Less is more.
Unfiltered.
type Intent[-A,-B] =
  PartialFunction[
    HttpRequest[A],
    ResponseFunction[B]]
object Example extends Plan {
  def intent = {
    case GET(Path("ping")) =>
         ResponseString("pong")
  }
}
HttpRequest[A]
  object Example extends Plan {
    def intent = {
      case GET(Path("ping")) =>
           ResponseString("pong")
    }
  }
HttpRequest[A]
  object Example extends Plan {
    def intent = {
      case GET(Path("ping")) =>
           ResponseString("pong")
    }
  }

     ResponseFunction[B]
Roundup
Roundup
๏ Leverage simple language
  constructs.
Roundup
๏ Leverage simple language
  constructs.
 ๏ Easy to learn.
Roundup
๏ Leverage simple language
  constructs.
 ๏ Easy to learn.
 ๏ Easy to extend.
Roundup
๏ Leverage simple language
  constructs.
 ๏ Easy to learn.
 ๏ Easy to extend.
๏ Micro-framework: less is more.
Roundup
๏ Leverage simple language
  constructs.
 ๏ Easy to learn.
 ๏ Easy to extend.
๏ Micro-framework: less is more.
๏ Used by Meetup, RTM, Novus
Scaling Performance.
  Building the next Facebook (obviously)
Spray.
(and blueeyes)
type Route =
  RequestContext => Unit
path("foobar" / JavaUUID){ uuid =>
  get {
    _.completeWith {
      // load Foo instance by uuid
    }
  }
}
path("foobar" / JavaUUID){ uuid =>
  get {
    _.completeWith {
      // load Foo instance by uuid
    }
  }
}
path("foobar" / JavaUUID){ uuid =>
  get {
    _.completeWith {
      // load Foo instance by uuid
    }
  }
}
   implicit def foo[Foo : Marshaller]
case class Foo(whatever: String)

path("foobar" / JavaUUID){ uuid =>
  put {
    content(as[Foo]){ foo =>
      ...
    }
  }
}
Actors. Everywhere.
Detached
                          worker




HTTP Request    HTTP          Detached
                               worker
               Service



                          Detached
                           worker
def receive = {
  case HttpRequest(GET, "/", _, _, _) =>
  ...
}
Roundup
Roundup
๏ Totally actor-based
Roundup
๏ Totally actor-based
๏ Crazy-fast, non-blocking HTTP
  Server
Roundup
๏ Totally actor-based
๏ Crazy-fast, non-blocking HTTP
  Server
๏ Route definitions are just CPS
Roundup
๏ Totally actor-based
๏ Crazy-fast, non-blocking HTTP
  Server
๏ Route definitions are just CPS
๏ Typeclass-based (un)marshalling
Roundup
๏ Totally actor-based
๏ Crazy-fast, non-blocking HTTP
  Server
๏ Route definitions are just CPS
๏ Typeclass-based (un)marshalling
๏ Used by: VMWare, Zeebox, eBay
Scaling Features.
  Real-time, secure applications.
Lift.
def foo =
  "type=text" #> text(name, name = _) &
  "type=submit" #> submit(println _)

<form lift="foo">
  <p><input type="text" /></p>
  <p><input type="submit" /></p>
</form>
NodeSeq => NodeSeq

def foo =
  "type=text" #> text(name, name = _) &
  "type=submit" #> submit(println _)

<form lift="foo">
  <p><input type="text" /></p>
  <p><input type="submit" /></p>
</form>
<form action="/" method="post">
  <p><input type="text" name="F04FS5G5454" /></p>
  <p><input type="submit" name="F0S324435" /></p>
</form>
NodeSeq.
(a.k.a XSS-safe templates)
Unparsed("<strong>ABC</
       strong>")
Roundup
Roundup
๏ Secure by default
Roundup
๏ Secure by default
 ๏ Prevents common CSRF vulnerabilities
Roundup
๏ Secure by default
 ๏ Prevents common CSRF vulnerabilities
 ๏ XSS impossible without developer input
Roundup
๏ Secure by default
 ๏ Prevents common CSRF vulnerabilities
 ๏ XSS impossible without developer input
๏ Advocates server-controlled state
Roundup
๏ Secure by default
 ๏ Prevents common CSRF vulnerabilities
 ๏ XSS impossible without developer input
๏ Advocates server-controlled state
๏ Used by: 4sq, Stackmob, OpenStudy
What’s the
bottom line?
No.
Such.
Thing.
EOF
      @timperrett
github.com/timperrett
    timperrett.com

More Related Content

What's hot

JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...
JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...
JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...
PROIDEA
 
Async queue-transaction
Async queue-transaction Async queue-transaction
Async queue-transaction
Fei (James) Liu
 
Writing a fast HTTP parser
Writing a fast HTTP parserWriting a fast HTTP parser
Writing a fast HTTP parser
fukamachi
 
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir MeetupCachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
Abel Muíño
 
轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!
進錕 林進錕
 
Optimize perl5 code for perfomance freaks
Optimize perl5 code for perfomance freaksOptimize perl5 code for perfomance freaks
Optimize perl5 code for perfomance freaks
karupanerura
 
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Sylvain Zimmer
 
Hello elixir (and otp)
Hello elixir (and otp)Hello elixir (and otp)
Hello elixir (and otp)
Abel Muíño
 
Kotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platformsKotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platforms
Kirill Rozov
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
Sencha
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Hiroshi SHIBATA
 
Java 8 concurrency abstractions
Java 8 concurrency abstractionsJava 8 concurrency abstractions
Java 8 concurrency abstractions
Nawazish Mohammad Khan
 
Perl6 meets JVM
Perl6 meets JVMPerl6 meets JVM
Perl6 meets JVM
Tokuhiro Matsuno
 
Build RESTful API Using Express JS
Build RESTful API Using Express JSBuild RESTful API Using Express JS
Build RESTful API Using Express JS
Cakra Danu Sedayu
 
2021laravelconftwslides6
2021laravelconftwslides62021laravelconftwslides6
2021laravelconftwslides6
LiviaLiaoFontech
 
Test::Kantan - Perl and Testing
Test::Kantan - Perl and TestingTest::Kantan - Perl and Testing
Test::Kantan - Perl and Testing
Tokuhiro Matsuno
 
Rack
RackRack
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
Barry Jones
 
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
Tatsuhiko Miyagawa
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 

What's hot (20)

JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...
JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...
JDD 2016 - Andrej Mihály - How To Bake Reactive Behavior Into Your Java Ee Ap...
 
Async queue-transaction
Async queue-transaction Async queue-transaction
Async queue-transaction
 
Writing a fast HTTP parser
Writing a fast HTTP parserWriting a fast HTTP parser
Writing a fast HTTP parser
 
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir MeetupCachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
 
轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!
 
Optimize perl5 code for perfomance freaks
Optimize perl5 code for perfomance freaksOptimize perl5 code for perfomance freaks
Optimize perl5 code for perfomance freaks
 
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
 
Hello elixir (and otp)
Hello elixir (and otp)Hello elixir (and otp)
Hello elixir (and otp)
 
Kotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platformsKotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platforms
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
 
Java 8 concurrency abstractions
Java 8 concurrency abstractionsJava 8 concurrency abstractions
Java 8 concurrency abstractions
 
Perl6 meets JVM
Perl6 meets JVMPerl6 meets JVM
Perl6 meets JVM
 
Build RESTful API Using Express JS
Build RESTful API Using Express JSBuild RESTful API Using Express JS
Build RESTful API Using Express JS
 
2021laravelconftwslides6
2021laravelconftwslides62021laravelconftwslides6
2021laravelconftwslides6
 
Test::Kantan - Perl and Testing
Test::Kantan - Perl and TestingTest::Kantan - Perl and Testing
Test::Kantan - Perl and Testing
 
Rack
RackRack
Rack
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
 
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
 

Viewers also liked

Building Enigma with State Monad & Lens
Building Enigma with State Monad & LensBuilding Enigma with State Monad & Lens
Building Enigma with State Monad & Lens
Timothy Perrett
 
Scala Helix
Scala HelixScala Helix
Scala Helix
Timothy Perrett
 
Functional Programming at Verizon
Functional Programming at VerizonFunctional Programming at Verizon
Functional Programming at Verizon
Timothy Perrett
 
BRUG - Hello, Scala
BRUG - Hello, ScalaBRUG - Hello, Scala
BRUG - Hello, Scala
Timothy Perrett
 
Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016
Timothy Perrett
 
Large-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at VerizonLarge-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at Verizon
Timothy Perrett
 

Viewers also liked (6)

Building Enigma with State Monad & Lens
Building Enigma with State Monad & LensBuilding Enigma with State Monad & Lens
Building Enigma with State Monad & Lens
 
Scala Helix
Scala HelixScala Helix
Scala Helix
 
Functional Programming at Verizon
Functional Programming at VerizonFunctional Programming at Verizon
Functional Programming at Verizon
 
BRUG - Hello, Scala
BRUG - Hello, ScalaBRUG - Hello, Scala
BRUG - Hello, Scala
 
Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016
 
Large-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at VerizonLarge-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at Verizon
 

Similar to Scalalable Language for a Scalable Web

Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
Alona Mekhovova
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
LittleBIGRuby
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
Ben Scofield
 
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
Masahiro Nagano
 
Express Presentation
Express PresentationExpress Presentation
Express Presentation
aaronheckmann
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
James Titcumb
 
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and FluxTPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and Flux
Jirat Kijlerdpornpailoj
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
Hiro Asari
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
Tatsuhiko Miyagawa
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
James Titcumb
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
b_kathir
 
The Atmosphere Framework
The Atmosphere FrameworkThe Atmosphere Framework
The Atmosphere Framework
jfarcand
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
Oleg Podsechin
 
Implementing Comet using PHP
Implementing Comet using PHPImplementing Comet using PHP
Implementing Comet using PHP
King Foo
 
Sprockets
SprocketsSprockets
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)
xSawyer
 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
James Titcumb
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
Jennifer Bourey
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
ciklum_ods
 

Similar to Scalalable Language for a Scalable Web (20)

Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
 
Express Presentation
Express PresentationExpress Presentation
Express Presentation
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and FluxTPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and Flux
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 
The Atmosphere Framework
The Atmosphere FrameworkThe Atmosphere Framework
The Atmosphere Framework
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
Implementing Comet using PHP
Implementing Comet using PHPImplementing Comet using PHP
Implementing Comet using PHP
 
Sprockets
SprocketsSprockets
Sprockets
 
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)
 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 

More from Timothy Perrett

Nelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional WorldNelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional World
Timothy Perrett
 
Online Experimentation with Immutable Infrastructure
Online Experimentation with Immutable InfrastructureOnline Experimentation with Immutable Infrastructure
Online Experimentation with Immutable Infrastructure
Timothy Perrett
 
Javazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web ApplicationsJavazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web Applications
Timothy Perrett
 
Concurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaConcurrency and Parallelism with Scala
Concurrency and Parallelism with Scala
Timothy Perrett
 
Scaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web ApplicationsScaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web Applications
Timothy Perrett
 
Bathcamp 2010-riak
Bathcamp 2010-riakBathcamp 2010-riak
Bathcamp 2010-riak
Timothy Perrett
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
Timothy Perrett
 
Devoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkDevoxx 2009: The Lift Framework
Devoxx 2009: The Lift Framework
Timothy Perrett
 

More from Timothy Perrett (8)

Nelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional WorldNelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional World
 
Online Experimentation with Immutable Infrastructure
Online Experimentation with Immutable InfrastructureOnline Experimentation with Immutable Infrastructure
Online Experimentation with Immutable Infrastructure
 
Javazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web ApplicationsJavazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web Applications
 
Concurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaConcurrency and Parallelism with Scala
Concurrency and Parallelism with Scala
 
Scaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web ApplicationsScaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web Applications
 
Bathcamp 2010-riak
Bathcamp 2010-riakBathcamp 2010-riak
Bathcamp 2010-riak
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
 
Devoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkDevoxx 2009: The Lift Framework
Devoxx 2009: The Lift Framework
 

Recently uploaded

CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 

Recently uploaded (20)

CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 

Scalalable Language for a Scalable Web

Editor's Notes

  1. Good afternoon everyone, and welcome to this talk: scalable language; scalable web. My name is Timothy Perrett, and i&amp;#x2019;ve been kicking around in the Scala community since about the end of 2007; essentially before we had a reasonable collections library, akka, lift as we know it today, or any of the other awesome Scala projects that make up out lovely community. \n\nI like to make things though, and i&amp;#x2019;ve been involved in a wide range of projects, from web toolkits, to build systems to a myriad of other things. With that being said, I have a big interest in web programming, and its something I care a great deal about: most of the commercial projects I work on these days are web applications or services. \n
  2. I&amp;#x2019;m also the author of Lift in Action, the most complete guide to Lift available today; so if you have an interest in learning Lift, by all means pick up a copy.\n
  3. So today I&amp;#x2019;m going to be talking to you about how approaches to web programming have changed over the years, and how the features present in both the scala language and the within our community have influenced &amp;#x201C;solutions&amp;#x201D; to the problem of HTTP application programming.\n\nAs this talk is titled &amp;#x201C;scalable language; scalable web&amp;#x201D; I first what to reconsider the meaning of the word &amp;#x201C;scalable&amp;#x201D;.\n
  4. Scalability has very much become a buzzword in the business community, and we are often bombarded with blanket marketing that implies scalability is directly centred around performance concerns, and performance alone. \n\nWhilst it may be true that online sites and applications are growing faster than ever before, and indeed, at the end of 2011 there were some 555,000,000 sites online. Of that huge number though, only a very small portion are the Facebooks, Googles and twitters of this world. This is something we must consider when discussing scalability. \n\nAs you can see on the slide here, the dictionary defines scalability to mean &amp;#x201C;Able to be used or produced in a range of capabilities: it is scalable across a range of systems&amp;#x201D;. Not once does that sentence mention performance or &amp;#x201C;big data&amp;#x201D; or anything else suitably buzzword like. Ergo, we can consider this idea of scalability as being multi-faceted, having multiple applicable axis. In this talk I&amp;#x2019;ll be covering what could be three possible axis of scalability:\n- scaling down: something that is small, lightweight and has minimal overhead.\n- scaling up, or scaling performance: pretty much what the business folks take it as meaning; building the next facebook. obviously. \n- scaling features: scaling an idea; taking a single concept and applying it to everything you do. \n
  5. So before we get onto all that good stuff, I would just like to take you on a trip down memory lane... the year is 1995, and whilst Bill Gates was busy launching his &amp;#x201C;revolutionary&amp;#x201D; new operating system Windows 95, James Gosling was busy inventing servlets. \n\nServlets did remain useful after &amp;#x2019;95 though, unlike Windows unfortunately for Mr Gates.\n\n----- ERATA \n\nServlets were later formalised by Pawani Diwanji as part of JavaSofts Jeeves project in 1996[1]\n\n[1] http://www.mtvjug.org/Oct23.html\n
  6. Raise your hands if you recognise this code, or something similar to this, or if you&amp;#x2019;re still maintaing or writing something like this today...\n\nThis style of HTTP programming is 17 years old. When we look at nearly everything else we use today, &amp;#x201C;old&amp;#x201D; constitutes 6 months, or perhaps even a year. On that scale 17 years old is practically neolithic! This stuff is dinosaur technology.\n\n\n\n\n\n
  7. Whilst researching this talk I can across this great quote from a 1996 mountain view JUG agenda, which detailed the &amp;#x201C;Jeeves&amp;#x201D; project which the servlet API was originally a part of. The agenda states: &amp;#x201C;Jeeves defines the Java Servlet APIs for the quick and easy creation, installation, administration and security of Java-based network servers.&amp;#x201D;\n\nThat sounds awesomely whizzbang!... and at the time it really was. Now though, we know we can do better: its not 1995 or 96 anymore; things in our industry have changed, but, fundamentally web programming hasn&amp;#x2019;t changed on the JVM since its inception. Ok, things have been added, augmented and hastily bolted on, but at its core it hasn&amp;#x2019;t really changed.\n
  8. This strikes me as diametrically opposed to views on HTTP programming within the wider industry: things have changed irreparably in the past two years or so with the advent of HTML5. Browsers are now capable of delivering better, more seamless user experiences and interacting with richer server-side backends than ever before: event sources and web sockets being just two such examples.\n\nWith the pace of change being what it is, the unfortunate reality is that the servlet specification cannot keep up; the point in case there being the time it took servlet 3.0 to reach release status. \n
  9. Consider for a moment our vibrant Scala eco-system; its thankfully quite different to the Java eco-system, and its full of very smart folks who&amp;#x2019;ve approached the problem of HTTP programming in a range of different, and innovative ways. These toolkits are numerous:\n- scalatra\n- play\n- lift\n- unfiltered\n- slinky\n- and many more\n\nGetting back to this idea of scalability, the first on my axis of possible interpretations of scalability was scaling down with lightweight toolkits.\n
  10. I once recall hearing a software industry anecdote that said that by increasing application complexity by 25% would boost the development effort by 200%. This is most fascinating, as one has to consider what happens when situation is reversed: remove 25% of the complexity, and slash the development effort and cost of that project. \n\nOf course, this can&amp;#x2019;t work for every conceivable application, but as per the introduction, many, many applications will never need to scale to anything more than a single instance. \n
  11. Unfiltered is a lightweight, stateless HTTP abstraction that can sit atop many different types of backend server, from our old friend the servlet API, to newer platforms like Netty. In any case, Unfiltered&amp;#x2019;s API is exceedingly lightweight and solely based around two Scala language concepts: function composition and pattern matching.\n
  12. Intents are just partial functions\n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. 1. ergo simple learning curve\n\n
  19. 1. ergo simple learning curve\n\n
  20. 1. ergo simple learning curve\n\n
  21. 1. ergo simple learning curve\n\n
  22. 1. ergo simple learning curve\n\n
  23. \n
  24. introduction to spray with a quick mention of its blueeyes lineage \n\ninsanely fast: 65k req/s which is slightly faster than netty \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. Architecturally speaking, Spray is entirely built on actors: HTTP Requests are just immutable messages.\n
  33. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  34. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  35. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  36. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  37. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  38. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  39. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  40. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  41. This a gross over-simplification of how spray works, but you can visualise HTTP requests as incoming messages to the HTTP Service actor, which in turn spawns a new worker actor with a request context continuation to execute and respond to continue the request processing. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. talk about lifts security features\n\nImplements its own session storage so the session is fully type-safe\n
  49. introduction to lift \n\nstateful web\n\nOne of the oldest scala projects around\n\n\n
  50. \n
  51. \n
  52. \n
  53. Prevents CSRF\n
  54. Prevents CSRF\n
  55. Templates are validated XML, not a bunch of strings that are simply munged together. The result is that anytime you want to pass unescaped content you have to be very explicit about it, the toolkit forces the developer to understand why he/she is doing that.\n\nThis massively helps in preventing XSS vulnerable code getting into production by accident. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. In this talk i&amp;#x2019;ve demonstrated three distinct ways in which Scala has had an impact on the design of web toolkits within our eco-system. Whilst its fairly easy to see that each tool is distinctly different from its fellow projects, there is a degree of commonality throughout, and that&amp;#x2019;s composition. \n\nFrom core APIs, to higher level routing DSLs and templating: the upshot of highly compassable systems is more modularity, code that is easier to maintain, and far simpler to reason about. \n\nGone are the days of monolithic Spring or JEE systems! HTTP toolkits in Scala let you achieve things that are either not easily doable with servlets, or require a dependency chain as long as your arm to make it happen.\n\n\n
  65. With all that good stuff being said, its important to understand that there are no panaceas, no silver bullets. \n\nThe real take away from this presentation is that most of the HTTP toolkits differ considerably from one another. Each has its own strengths and weaknesses, and its more important than ever to understand your own use case and make the right tooling choice to solve your problem. \n\n\n
  66. With all that good stuff being said, its important to understand that there are no panaceas, no silver bullets. \n\nThe real take away from this presentation is that most of the HTTP toolkits differ considerably from one another. Each has its own strengths and weaknesses, and its more important than ever to understand your own use case and make the right tooling choice to solve your problem. \n\n\n
  67. With that, thank you very much for listening. If anyone has any questions I&amp;#x2019;d be happy to answer them. \n
  68. With that, thank you very much for listening. If anyone has any questions I&amp;#x2019;d be happy to answer them. \n