Use all the buzzwords

Preview:

DESCRIPTION

Backbone JS Over Rails In The Cloud

Citation preview

BACKBONE.JS OVER RAILS IN THE CLOUD

Jared Faris

@jaredthenerd

jared@jaredthenerd.com

ABOUT ME

LET’S TELL A STORY!

OOPS

LEVEL 0 – ATTEMPT 2

RUBY ON RAILS

YOU’VE FOUND RUBY

AND ALSO RAILS

THE EASY WINS People write a lot of code for you

Really easy to get started

Great community support

THE LESS CLEAR THINGS “Open source”

Why not Python? Why not .NET/Java/etc?

“Automagic” breaks quickly

Server-side is becoming less important

LEVEL 0 – COMPLETED

LEVEL 1– BUILDING ON RAILS

• HAML (not ERB)

• SASS (not CSS)

• CoffeeScript (not JavaScript)

• Ruby (not… ok, we kept Ruby)

HAML EXAMPLE

SASS EXAMPLE

SCSS EXAMPLE

AUTHS• Authentication

• Authorization

• Build or “Buy”

Security

CANCAN EXAMPLE

OTHER GEMS

• Redcarpet

• Ruby OAuth

• Braintree

• Sendgrid

• Paperclip

• Mongoid

Other Gems

LEVEL 1 - COMPLETE

LEVEL 2 - DATABLACK MAGICAKA DATABASES

SCARY DBS• ORMs hide the database

• Ruby’s automatic inclusion of

ActiveRecord encourages little DB

thought

• Developers automatically build

relational schemas

• Black Mage has a cool hat

OUR DATA• Data frequently comes in isolated

silos

• Little of our data was traditionally

“relational”

• We could rebuild data sets later for

reporting if we needed to

• Scalability and ease of maintenance

mattered heavily. We aren’t Ops folks

MONGO DB

• Document store (NoSQL)

• JavaScript based

• Easy clustering

• Run local and on servers

MongoDB

MONGO QUERY EXAMPLE

MONGOID

• ODM – Object Document Mapper

• Maps Active Record interactions to

MongoDB

• Quit thinking about persistence and

just think about objects

Mongoid

MONGOID QUERY EXAMPLE

LEVEL 3 – “JSONAPI”JSON API

JSON API EXAMPLE

JAVASCRIPT BITS

• Templating

• Objects for widgets

• Namespacing

COFFEESCRIPT

COFFEESCRIPT

COFFEESCRIPT.ORG

LEVEL 4 - FRAMEWORKS• Started with jQuery

• Added templates

• Switched to Knockout

• Ended up on Backbone

• And then some Marionette

LEVEL 5 – DEV ENV

DEV ENV• Local development (local Rails,

Mongo, etc)

• Initially TeamCity for CI running on

a VM

• Fair bit of RSpec and Jasmine

GITHUB

TEAMCITY CRASH

Switched to

Semaphore

VM CRASH!!!

SEMAPHORE

EC2 InstancesInternet

Security Group

DNS Resolution

LEVEL 6 - PRODUCTIONPRODUCTION

TOP RUBY RESOURCES• Ruby Koans

• Ruby on Rails Guides

• RailsCasts

• Ruby Toolbox

• Paid code reviews

TOP JS RESOURCES• JavaScript: The Good Parts

• Backbone Koans

• Derek Bailey’s blogs

• Project homepages

WARP PIPE

Jared Faris

@jaredthenerd

jared@jaredthenerd.com