Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Freemium enterprise social network Acquired by Microsoft in 2012 Evolved into a service oriented architecture

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

We didn’t drop Rails.

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Look at how another framework solves problems Choose the right stack to build on Apply the good parts back to our Ruby/Rails apps

Slide 14

Slide 14 text

Look at how another framework solves problems Choose the right stack to build on Apply the good parts back to our Ruby/Rails apps

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

$  java  -­‐jar  target/dropwizard-­‐demo.jar  server  sample.yml   INFO    [2014-­‐04-­‐25  15:11:30,057]  io.dropwizard.server.ServerFactory:  Starting   SampleService                                                                            .__      ____  ___    ________        _____  ______  |    |      ____   _/  __  \\    \/    /\__    \    /          \\____  \|    |  _/  __  \   \    ___/  >        <    /  __  \|    Y  Y    \    |_>  >    |_\    ___/    \___    >__/\_  \(____    /__|_|    /      __/|____/\___    >            \/            \/          \/            \/|__|                          \/     WARN    [2014-­‐04-­‐25  15:11:30,520]  io.dropwizard.setup.AdminEnvironment:   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   !        THIS  APPLICATION  HAS  NO  HEALTHCHECKS.  THIS  MEANS  YOU  WILL  NEVER  KNOW            !   !          IF  IT  DIES  IN  PRODUCTION,  WHICH  MEANS  YOU  WILL  NEVER  KNOW  IF  YOU'RE            !   !        LETTING  YOUR  USERS  DOWN.  YOU  SHOULD  ADD  A  HEALTHCHECK  FOR  EACH  OF  YOUR        !   !                  APPLICATION'S  DEPENDENCIES  WHICH  FULLY  (BUT  LIGHTLY)  TESTS  IT.              !   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Configuration class Application class Representation classes Resource classes Health check classes Rails.application.config Application class Views + Jbuilder/gem Controllers + Routes Gem/addon

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

$  mvn  clean  package   $  java  -­‐jar  target/helloworld.jar  server  server.yml     INFO    [2014-­‐04-­‐15  06:18:35,695]  io.dropwizard.server.ServerFactory:  Starting   SampleService   INFO    [2014-­‐04-­‐15  06:18:35,947]  io.dropwizard.jersey.DropwizardResourceConfig:  The   following  paths  were  found  for  the  configured  resources:            GET          /hello-­‐world/{name}  (com.example.helloworld.resources.HelloWorldResource)     INFO    [2014-­‐04-­‐15  06:18:36,166]  io.dropwizard.setup.AdminEnvironment:  tasks  =            POST        /tasks/gc  (io.dropwizard.servlets.tasks.GarbageCollectionTask)     INFO    [2014-­‐04-­‐15  06:18:36,175]  org.eclipse.jetty.server.ServerConnector:  Started   application@29a19259{HTTP/1.1}{0.0.0.0:8080}   INFO    [2014-­‐04-­‐15  06:18:36,176]  org.eclipse.jetty.server.ServerConnector:  Started   admin@2e8f2669{HTTP/1.1}{0.0.0.0:8081}  

Slide 27

Slide 27 text

$  curl  http://0.0.0.0:8080/hello-­‐world/mundo  -­‐I     HTTP/1.1  200  OK   Date:  Tue,  15  Apr  2014  05:02:25  GMT   Cache-­‐Control:  no-­‐transform,  max-­‐age=86400   Content-­‐Type:  text/plain   Vary:  Accept-­‐Encoding   Transfer-­‐Encoding:  chunked     Hello,  mundo!  

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

$  curl  http://0.0.0.0:8081/healthcheck?pretty=true  -­‐I     HTTP/1.1  500  Server  Error   Date:  Tue,  15  Apr  2014  04:53:33  GMT   Content-­‐Type:  application/json   Cache-­‐Control:  must-­‐revalidate,no-­‐cache,no-­‐store   Content-­‐Length:  172     {      "deadlocks"  :  {          "healthy"  :  true      },      "random"  :  {          "healthy"  :  false,          "message"  :  "Not  one,  how  can  I  possibly  serve  traffic?"      }   }  

Slide 30

Slide 30 text

$  curl  http://0.0.0.0:8081/healthcheck?pretty=true  -­‐I     HTTP/1.1  200  OK   Date:  Tue,  15  Apr  2014  04:54:32  GMT   Content-­‐Type:  application/json   Cache-­‐Control:  must-­‐revalidate,no-­‐cache,no-­‐store   Content-­‐Length:  87     {      "deadlocks"  :  {          "healthy"  :  true      },      "random"  :  {          "healthy"  :  true      }   }  

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Look at how another framework solves problems Choose the right stack to build on Apply the good parts back to our Ruby/Rails apps

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

process_action.action_controller deliver.action_mailer sql.active_record cache_read.active_support cache_write.active_support render_template.action_view

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Run statsd on each instance Calculate percentiles: p75, p90, p95, and p99 Report somewhere to make dashboards and pretty graphs

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Looks like we rotate logs at the same time every night. Goodbye I/O.

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Query the database? Pull from the cache? Talk to an external service? Log an event? Queue a message? Send an email?

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

Look at how another framework solves problems Choose the right stack to build on Apply the good parts back to our Ruby/Rails apps

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

Runbook Health check Easily deployable Circuit breakers PagerDuty alerts Metrics Logging & rotation Exception tracking Configuration repo HA configuration Backups Disaster recovery Process control CI build Code coverage

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Probably Yes Yes Yes It helps ? ?

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

Fast or frequent development iterations To aggregate sequential sources or a single source Expressiveness for business rules or through a DSL To perform tasks asynchronously

Slide 54

Slide 54 text

To be in the critical performance path True parallelization of tasks or gathering of data Support for lots of concurrent connections Large heaps to keep things in memory

Slide 55

Slide 55 text

Stable API Parallelization Critical performance Fast/frequent dev All data in payload Performs tasks async Convention/DSL based Concurrent connections

Slide 56

Slide 56 text

For many things we’ve done, Rails has proven more beneficial than other Ruby alternatives We’re not satisfied with that as an answer, its just the state of the world today Last year we pretty much had 1-‐2 Rails apps, today we have 5-‐6 and more underway

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

Brian Morton / @brianxq3 eng.yammer.com