42
BACKBONE.JS OVER RAILS IN THE CLOUD Jared Faris @jaredthenerd jared@jaredthenerd.com

Use all the buzzwords

Embed Size (px)

DESCRIPTION

Backbone JS Over Rails In The Cloud

Citation preview

Page 1: Use all the buzzwords

BACKBONE.JS OVER RAILS IN THE CLOUD

Jared Faris

@jaredthenerd

[email protected]

Page 2: Use all the buzzwords

ABOUT ME

Page 3: Use all the buzzwords
Page 4: Use all the buzzwords

LET’S TELL A STORY!

Page 5: Use all the buzzwords

OOPS

Page 6: Use all the buzzwords
Page 7: Use all the buzzwords

LEVEL 0 – ATTEMPT 2

Page 8: Use all the buzzwords

RUBY ON RAILS

YOU’VE FOUND RUBY

AND ALSO RAILS

Page 9: Use all the buzzwords

THE EASY WINS People write a lot of code for you

Really easy to get started

Great community support

Page 10: Use all the buzzwords

THE LESS CLEAR THINGS “Open source”

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

“Automagic” breaks quickly

Server-side is becoming less important

Page 11: Use all the buzzwords

LEVEL 0 – COMPLETED

Page 12: Use all the buzzwords

LEVEL 1– BUILDING ON RAILS

• HAML (not ERB)

• SASS (not CSS)

• CoffeeScript (not JavaScript)

• Ruby (not… ok, we kept Ruby)

Page 13: Use all the buzzwords

HAML EXAMPLE

Page 14: Use all the buzzwords

SASS EXAMPLE

Page 15: Use all the buzzwords

SCSS EXAMPLE

Page 16: Use all the buzzwords

AUTHS• Authentication

• Authorization

• Build or “Buy”

Security

Page 17: Use all the buzzwords

CANCAN EXAMPLE

Page 18: Use all the buzzwords

OTHER GEMS

• Redcarpet

• Ruby OAuth

• Braintree

• Sendgrid

• Paperclip

• Mongoid

Other Gems

Page 19: Use all the buzzwords

LEVEL 1 - COMPLETE

Page 20: Use all the buzzwords

LEVEL 2 - DATABLACK MAGICAKA DATABASES

Page 21: Use all the buzzwords

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

Page 22: Use all the buzzwords

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

Page 23: Use all the buzzwords

MONGO DB

• Document store (NoSQL)

• JavaScript based

• Easy clustering

• Run local and on servers

MongoDB

Page 24: Use all the buzzwords

MONGO QUERY EXAMPLE

Page 25: Use all the buzzwords

MONGOID

• ODM – Object Document Mapper

• Maps Active Record interactions to

MongoDB

• Quit thinking about persistence and

just think about objects

Mongoid

Page 26: Use all the buzzwords

MONGOID QUERY EXAMPLE

Page 27: Use all the buzzwords

LEVEL 3 – “JSONAPI”JSON API

Page 28: Use all the buzzwords

JSON API EXAMPLE

Page 29: Use all the buzzwords

JAVASCRIPT BITS

• Templating

• Objects for widgets

• Namespacing

Page 30: Use all the buzzwords

COFFEESCRIPT

COFFEESCRIPT

Page 31: Use all the buzzwords

COFFEESCRIPT.ORG

Page 32: Use all the buzzwords

LEVEL 4 - FRAMEWORKS• Started with jQuery

• Added templates

• Switched to Knockout

• Ended up on Backbone

• And then some Marionette

Page 33: Use all the buzzwords

LEVEL 5 – DEV ENV

Page 34: Use all the buzzwords

DEV ENV• Local development (local Rails,

Mongo, etc)

• Initially TeamCity for CI running on

a VM

• Fair bit of RSpec and Jasmine

Page 35: Use all the buzzwords

GITHUB

Page 36: Use all the buzzwords

TEAMCITY CRASH

Switched to

Semaphore

VM CRASH!!!

Page 37: Use all the buzzwords

SEMAPHORE

Page 38: Use all the buzzwords

EC2 InstancesInternet

Security Group

DNS Resolution

LEVEL 6 - PRODUCTIONPRODUCTION

Page 39: Use all the buzzwords

TOP RUBY RESOURCES• Ruby Koans

• Ruby on Rails Guides

• RailsCasts

• Ruby Toolbox

• Paid code reviews

Page 40: Use all the buzzwords

TOP JS RESOURCES• JavaScript: The Good Parts

• Backbone Koans

• Derek Bailey’s blogs

• Project homepages

Page 41: Use all the buzzwords

WARP PIPE

Page 42: Use all the buzzwords

Jared Faris

@jaredthenerd

[email protected]