SlideShare a Scribd company logo
Ruby-on-Rails

&
PostgreSQL
John Ashmead
Ruby-on-Rails
•

Based on Ruby

•

A Framework, like Django

•

Widely popular

•

Ruby + ActiveRecord + Lots of Web Stuff + Lots of
other Stuff

•

Michael Hardt: http://ruby.railstutorial.org
Ruby Version
Manager
•

RVM lets you run multiple versions of ruby

•

Copies everything into some trees, then switches
pointers around

•

Manages gems & gemsets

•

Bundle install, bundle update
Gemfile
source 'https://rubygems.org'
!

ruby '2.0.0'
!

# Make sure we are using latest ‘rails’
gem 'rails', '4.0.0'
!

# Use Postgres as the database for Active Record
gem 'pg'
!

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
!

# switch to bootstrap, rspec, factory_girl, selenium,
capybara
!

…
ActiveRecord
•

Database adaptor

id

•

General purpose

name

•

Convention over
configuration

•

Reasonable defaults

•

Standalone product

maps

description
created_at
updated_at
Finally, PostgreSQL
•

‘pg’ gem

•

Provides ActiveRecord with
interface to Postgres

•

AR has an “execute”
function that lets you run
raw sql

•

‘postgres-pr’ gem gives
access to PostgreSQL
specific features, if needed
Foreign Keys
•

ActiveRecord has a lot of “associations”

•

Has_many, belongs_to, has_and_belongs_to_many

•

Doesn’t clean up the existing database

•

Doesn’t automatically generate the relevant keys

•

Doesn’t fix the metadata
create_table "maps", force: true do |t|
t.integer "user_id"
t.string
"map_type",
t.string
"name"
t.text
"description"
t.decimal "map_width"
t.decimal "map_height"
t.datetime "created_at"
t.datetime "updated_at"
end
CREATE TABLE maps (
id integer NOT NULL,
user_id integer,
map_type character varying(255),
name character varying(255),
description text,
map_width numeric,
map_height numeric,
created_at timestamp without time zone,
updated_at timestamp without time zone
);

Weirder
than
it
looks
Migrations
rails generate scaffold Map user_id:integer map_type:string
name:string description:text map_width:decimal
map_height:decimal

class CreateMaps < ActiveRecor
def change
create_table :maps do |t|
t.integer :user_id
t.string :map_type,
t.string :name,
t.text :description
t.decimal :map_width
t.decimal :map_height
!

t.timestamps
end
end
end
rake db:migrate && rails db:migrate RAILS_ENV=test
Heroku stack
•

Ruby-on-Rails front end

•

PostgreSQL preferred

•

Well documented

•

Free up to a reasonable point

•

Integrated with github

•

Lots of tools

•

Mostly works

•

https://www.heroku.com
Red

Green

Refactor

•

Agile & Stories

•

Examples & TDD (Testdriven development) over
APIs

•

MVC: Model/View/
Controller

•

Upgrades in RoR much
trickier than in PostgreSQL
Domain Specific Languages
•

•

PostgreSQL makes it
easy to hook existing
languages in: i.e.
Javascript as a server
language.

•

Gems versus packages.
About 30K gems! Of
widely varying quality.

•

YMMV

describe "home page" do

let!(:person) 
{ FactoryGirl.create(:person) }

}

Ruby makes it easy to
write DSLs

before {
sign_in person
visit home_people_path(person)
}
it { should have_content(person.name)
it { should have_title(person.name) }
end
Long learning curves
•

Ruby-on-rails has a
lot of levels

•

Achieving rapport
with rails takes time

•

Help: railscasts,
stackoverflow, …

•

Grow little neurons,
grow (damn you!)
There’s a page for that
•

http://localhost:8081/phpPgAdmin/

•

http://guides.rubyonrails.org

•

http://api.rubyonrails.org

•

https://codeclimate.com

•

http://localhost:3000

•

https://github.com

•

http://ruby.railstutorial.org/book/ruby-on-rails-tutorial?
version=4.0

•

http://ruby-doc.com/docs/ProgrammingRuby/

•

…

More Related Content

What's hot

Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. Redis
Tim Lossen
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
London Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in ProductionLondon Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in Production
London HashiCorp User Group
 
using-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offlineusing-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offline
Andrej Babolcai
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel Aviv
Amazon Web Services
 
Adding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of TricksAdding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of Tricks
siculars
 
Terraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentTerraform Modules and Continuous Deployment
Terraform Modules and Continuous Deployment
Zane Williamson
 
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSpherevBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
Aaron Delp
 
Building a Better Mousetrap for the Cloud
Building a Better Mousetrap for the CloudBuilding a Better Mousetrap for the Cloud
Building a Better Mousetrap for the Cloud
elliando dias
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the World
SATOSHI TAGOMORI
 
Intro to Clojure lightningtalk
Intro to Clojure lightningtalkIntro to Clojure lightningtalk
Intro to Clojure lightningtalk
Nola Stowe
 
Terraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud ServicesTerraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud Services
Martin Schütte
 
IDLs
IDLsIDLs
Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)
Radek Simko
 
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rick Copeland
 
Altitude SF 2017: Stories from TED
Altitude SF 2017: Stories from TEDAltitude SF 2017: Stories from TED
Altitude SF 2017: Stories from TED
Fastly
 
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity StonesACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
AWS User Group Kochi
 
Aws opsworks for developers and designers
Aws opsworks for developers and designersAws opsworks for developers and designers
Aws opsworks for developers and designers
Wojciech Ziniewicz
 
Terraform in action
Terraform in actionTerraform in action
Terraform in action
Damien Pacaud
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps Krakow
Anton Babenko
 

What's hot (20)

Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. Redis
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
London Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in ProductionLondon Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in Production
 
using-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offlineusing-apache-spark-for-generating-elasticsearch-indices-offline
using-apache-spark-for-generating-elasticsearch-indices-offline
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel Aviv
 
Adding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of TricksAdding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of Tricks
 
Terraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentTerraform Modules and Continuous Deployment
Terraform Modules and Continuous Deployment
 
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSpherevBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
vBrownBag @ VMworld - Apache CloudStack (ACS) & vSphere
 
Building a Better Mousetrap for the Cloud
Building a Better Mousetrap for the CloudBuilding a Better Mousetrap for the Cloud
Building a Better Mousetrap for the Cloud
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the World
 
Intro to Clojure lightningtalk
Intro to Clojure lightningtalkIntro to Clojure lightningtalk
Intro to Clojure lightningtalk
 
Terraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud ServicesTerraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud Services
 
IDLs
IDLsIDLs
IDLs
 
Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)
 
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and Python
 
Altitude SF 2017: Stories from TED
Altitude SF 2017: Stories from TEDAltitude SF 2017: Stories from TED
Altitude SF 2017: Stories from TED
 
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity StonesACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
ACDKOCHI19 - Become Thanos of the Lambda Land: Wield all the Infinity Stones
 
Aws opsworks for developers and designers
Aws opsworks for developers and designersAws opsworks for developers and designers
Aws opsworks for developers and designers
 
Terraform in action
Terraform in actionTerraform in action
Terraform in action
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps Krakow
 

Viewers also liked

Not your Grandfather's Gravity
Not your Grandfather's GravityNot your Grandfather's Gravity
Not your Grandfather's Gravity
John Ashmead
 
MAMP Stack - Macintosh, Apache, MySQL, PHP
MAMP Stack - Macintosh, Apache, MySQL, PHPMAMP Stack - Macintosh, Apache, MySQL, PHP
MAMP Stack - Macintosh, Apache, MySQL, PHP
John Ashmead
 
Thought experiments
Thought experimentsThought experiments
Thought experiments
John Ashmead
 
Time & Quantum Mechanics
Time & Quantum MechanicsTime & Quantum Mechanics
Time & Quantum Mechanics
John Ashmead
 
invisibility: Theory and Practice - v1
invisibility:  Theory and Practice - v1invisibility:  Theory and Practice - v1
invisibility: Theory and Practice - v1
John Ashmead
 
Star Gates: the Theory and Practice
Star Gates:  the Theory and PracticeStar Gates:  the Theory and Practice
Star Gates: the Theory and Practice
John Ashmead
 
The Future of Time Travel
The Future of Time TravelThe Future of Time Travel
The Future of Time Travel
John Ashmead
 

Viewers also liked (7)

Not your Grandfather's Gravity
Not your Grandfather's GravityNot your Grandfather's Gravity
Not your Grandfather's Gravity
 
MAMP Stack - Macintosh, Apache, MySQL, PHP
MAMP Stack - Macintosh, Apache, MySQL, PHPMAMP Stack - Macintosh, Apache, MySQL, PHP
MAMP Stack - Macintosh, Apache, MySQL, PHP
 
Thought experiments
Thought experimentsThought experiments
Thought experiments
 
Time & Quantum Mechanics
Time & Quantum MechanicsTime & Quantum Mechanics
Time & Quantum Mechanics
 
invisibility: Theory and Practice - v1
invisibility:  Theory and Practice - v1invisibility:  Theory and Practice - v1
invisibility: Theory and Practice - v1
 
Star Gates: the Theory and Practice
Star Gates:  the Theory and PracticeStar Gates:  the Theory and Practice
Star Gates: the Theory and Practice
 
The Future of Time Travel
The Future of Time TravelThe Future of Time Travel
The Future of Time Travel
 

Similar to Ruby on Rails & PostgreSQL - v2

Wider than rails
Wider than railsWider than rails
Wider than rails
Alexey Nayden
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
Roger Xia
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
Workshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - SuestraWorkshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - Suestra
Mario IC
 
Rack
RackRack
Rack
shen liu
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
Blazing Cloud
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
Wen-Tien Chang
 
Upgrading to rails3
Upgrading to rails3Upgrading to rails3
Upgrading to rails3
Yi-Ting Cheng
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
Mario-Leander Reimer
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
QAware GmbH
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
bhavesh-gloscon
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
Wen-Tien Chang
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
Dan Davis
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
Reuven Lerner
 
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd についてKubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
LINE Corporation
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOps
Ricardo Sanchez
 

Similar to Ruby on Rails & PostgreSQL - v2 (20)

Wider than rails
Wider than railsWider than rails
Wider than rails
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Workshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - SuestraWorkshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - Suestra
 
Rack
RackRack
Rack
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
Upgrading to rails3
Upgrading to rails3Upgrading to rails3
Upgrading to rails3
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd についてKubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOps
 

More from John Ashmead

The Quantum Internet: Hype or the Next Step
The Quantum Internet:  Hype or the Next StepThe Quantum Internet:  Hype or the Next Step
The Quantum Internet: Hype or the Next Step
John Ashmead
 
How to build a PostgreSQL-backed website quickly
How to build a PostgreSQL-backed website quicklyHow to build a PostgreSQL-backed website quickly
How to build a PostgreSQL-backed website quickly
John Ashmead
 
The Quantum Internet: Hype or the Next Step
The Quantum Internet:  Hype or the Next StepThe Quantum Internet:  Hype or the Next Step
The Quantum Internet: Hype or the Next Step
John Ashmead
 
Artificial Intelligence: Past, Present, Futures
Artificial Intelligence:  Past, Present, FuturesArtificial Intelligence:  Past, Present, Futures
Artificial Intelligence: Past, Present, Futures
John Ashmead
 
Time dispersion in time-of-arrival measurements
Time dispersion in time-of-arrival measurementsTime dispersion in time-of-arrival measurements
Time dispersion in time-of-arrival measurements
John Ashmead
 
Time dispersion in quantum mechanics -- Philcon 2019 version
Time dispersion in quantum mechanics -- Philcon 2019 versionTime dispersion in quantum mechanics -- Philcon 2019 version
Time dispersion in quantum mechanics -- Philcon 2019 version
John Ashmead
 
Time dispersion in quantum mechanics
Time dispersion in quantum mechanicsTime dispersion in quantum mechanics
Time dispersion in quantum mechanics
John Ashmead
 
Mars Or Bust!
Mars Or Bust!Mars Or Bust!
Mars Or Bust!
John Ashmead
 
Practical Telepathy: The Science & Engineering of Mind-Reading
Practical Telepathy:  The Science & Engineering of Mind-ReadingPractical Telepathy:  The Science & Engineering of Mind-Reading
Practical Telepathy: The Science & Engineering of Mind-Reading
John Ashmead
 
From Startup to Mature Company: PostgreSQL Tips and techniques
From Startup to Mature Company:  PostgreSQL Tips and techniquesFrom Startup to Mature Company:  PostgreSQL Tips and techniques
From Startup to Mature Company: PostgreSQL Tips and techniques
John Ashmead
 
Practical Telepathy: The Science & Engineering of Mind-Reading
Practical Telepathy:  The Science & Engineering of Mind-ReadingPractical Telepathy:  The Science & Engineering of Mind-Reading
Practical Telepathy: The Science & Engineering of Mind-Reading
John Ashmead
 
Stargates: Theory and Practice
Stargates:  Theory and PracticeStargates:  Theory and Practice
Stargates: Theory and Practice
John Ashmead
 
StarGates: Theory and Practice
StarGates:  Theory and PracticeStarGates:  Theory and Practice
StarGates: Theory and Practice
John Ashmead
 
Quantum dots
Quantum dotsQuantum dots
Quantum dots
John Ashmead
 
Time to the power of Tim
Time to the power of TimTime to the power of Tim
Time to the power of Tim
John Ashmead
 
How many universes are there, anyway
How many universes are there, anywayHow many universes are there, anyway
How many universes are there, anyway
John Ashmead
 
A Quantum of Mystery
A Quantum of MysteryA Quantum of Mystery
A Quantum of Mystery
John Ashmead
 
Converting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQLConverting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQL
John Ashmead
 
Seven War Stories and a Moral
Seven War Stories and a MoralSeven War Stories and a Moral
Seven War Stories and a Moral
John Ashmead
 
Automation
AutomationAutomation
Automation
John Ashmead
 

More from John Ashmead (20)

The Quantum Internet: Hype or the Next Step
The Quantum Internet:  Hype or the Next StepThe Quantum Internet:  Hype or the Next Step
The Quantum Internet: Hype or the Next Step
 
How to build a PostgreSQL-backed website quickly
How to build a PostgreSQL-backed website quicklyHow to build a PostgreSQL-backed website quickly
How to build a PostgreSQL-backed website quickly
 
The Quantum Internet: Hype or the Next Step
The Quantum Internet:  Hype or the Next StepThe Quantum Internet:  Hype or the Next Step
The Quantum Internet: Hype or the Next Step
 
Artificial Intelligence: Past, Present, Futures
Artificial Intelligence:  Past, Present, FuturesArtificial Intelligence:  Past, Present, Futures
Artificial Intelligence: Past, Present, Futures
 
Time dispersion in time-of-arrival measurements
Time dispersion in time-of-arrival measurementsTime dispersion in time-of-arrival measurements
Time dispersion in time-of-arrival measurements
 
Time dispersion in quantum mechanics -- Philcon 2019 version
Time dispersion in quantum mechanics -- Philcon 2019 versionTime dispersion in quantum mechanics -- Philcon 2019 version
Time dispersion in quantum mechanics -- Philcon 2019 version
 
Time dispersion in quantum mechanics
Time dispersion in quantum mechanicsTime dispersion in quantum mechanics
Time dispersion in quantum mechanics
 
Mars Or Bust!
Mars Or Bust!Mars Or Bust!
Mars Or Bust!
 
Practical Telepathy: The Science & Engineering of Mind-Reading
Practical Telepathy:  The Science & Engineering of Mind-ReadingPractical Telepathy:  The Science & Engineering of Mind-Reading
Practical Telepathy: The Science & Engineering of Mind-Reading
 
From Startup to Mature Company: PostgreSQL Tips and techniques
From Startup to Mature Company:  PostgreSQL Tips and techniquesFrom Startup to Mature Company:  PostgreSQL Tips and techniques
From Startup to Mature Company: PostgreSQL Tips and techniques
 
Practical Telepathy: The Science & Engineering of Mind-Reading
Practical Telepathy:  The Science & Engineering of Mind-ReadingPractical Telepathy:  The Science & Engineering of Mind-Reading
Practical Telepathy: The Science & Engineering of Mind-Reading
 
Stargates: Theory and Practice
Stargates:  Theory and PracticeStargates:  Theory and Practice
Stargates: Theory and Practice
 
StarGates: Theory and Practice
StarGates:  Theory and PracticeStarGates:  Theory and Practice
StarGates: Theory and Practice
 
Quantum dots
Quantum dotsQuantum dots
Quantum dots
 
Time to the power of Tim
Time to the power of TimTime to the power of Tim
Time to the power of Tim
 
How many universes are there, anyway
How many universes are there, anywayHow many universes are there, anyway
How many universes are there, anyway
 
A Quantum of Mystery
A Quantum of MysteryA Quantum of Mystery
A Quantum of Mystery
 
Converting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQLConverting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQL
 
Seven War Stories and a Moral
Seven War Stories and a MoralSeven War Stories and a Moral
Seven War Stories and a Moral
 
Automation
AutomationAutomation
Automation
 

Recently uploaded

Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
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
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
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
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 

Recently uploaded (20)

Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
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
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
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
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 

Ruby on Rails & PostgreSQL - v2

  • 2. Ruby-on-Rails • Based on Ruby • A Framework, like Django • Widely popular • Ruby + ActiveRecord + Lots of Web Stuff + Lots of other Stuff • Michael Hardt: http://ruby.railstutorial.org
  • 3. Ruby Version Manager • RVM lets you run multiple versions of ruby • Copies everything into some trees, then switches pointers around • Manages gems & gemsets • Bundle install, bundle update
  • 4. Gemfile source 'https://rubygems.org' ! ruby '2.0.0' ! # Make sure we are using latest ‘rails’ gem 'rails', '4.0.0' ! # Use Postgres as the database for Active Record gem 'pg' ! # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' ! # switch to bootstrap, rspec, factory_girl, selenium, capybara ! …
  • 5. ActiveRecord • Database adaptor id • General purpose name • Convention over configuration • Reasonable defaults • Standalone product maps description created_at updated_at
  • 6. Finally, PostgreSQL • ‘pg’ gem • Provides ActiveRecord with interface to Postgres • AR has an “execute” function that lets you run raw sql • ‘postgres-pr’ gem gives access to PostgreSQL specific features, if needed
  • 7. Foreign Keys • ActiveRecord has a lot of “associations” • Has_many, belongs_to, has_and_belongs_to_many • Doesn’t clean up the existing database • Doesn’t automatically generate the relevant keys • Doesn’t fix the metadata
  • 8. create_table "maps", force: true do |t| t.integer "user_id" t.string "map_type", t.string "name" t.text "description" t.decimal "map_width" t.decimal "map_height" t.datetime "created_at" t.datetime "updated_at" end CREATE TABLE maps ( id integer NOT NULL, user_id integer, map_type character varying(255), name character varying(255), description text, map_width numeric, map_height numeric, created_at timestamp without time zone, updated_at timestamp without time zone ); Weirder than it looks
  • 9. Migrations rails generate scaffold Map user_id:integer map_type:string name:string description:text map_width:decimal map_height:decimal class CreateMaps < ActiveRecor def change create_table :maps do |t| t.integer :user_id t.string :map_type, t.string :name, t.text :description t.decimal :map_width t.decimal :map_height ! t.timestamps end end end rake db:migrate && rails db:migrate RAILS_ENV=test
  • 10. Heroku stack • Ruby-on-Rails front end • PostgreSQL preferred • Well documented • Free up to a reasonable point • Integrated with github • Lots of tools • Mostly works • https://www.heroku.com
  • 11. Red Green Refactor • Agile & Stories • Examples & TDD (Testdriven development) over APIs • MVC: Model/View/ Controller • Upgrades in RoR much trickier than in PostgreSQL
  • 12. Domain Specific Languages • • PostgreSQL makes it easy to hook existing languages in: i.e. Javascript as a server language. • Gems versus packages. About 30K gems! Of widely varying quality. • YMMV describe "home page" do let!(:person) { FactoryGirl.create(:person) } } Ruby makes it easy to write DSLs before { sign_in person visit home_people_path(person) } it { should have_content(person.name) it { should have_title(person.name) } end
  • 13. Long learning curves • Ruby-on-rails has a lot of levels • Achieving rapport with rails takes time • Help: railscasts, stackoverflow, … • Grow little neurons, grow (damn you!)
  • 14. There’s a page for that • http://localhost:8081/phpPgAdmin/ • http://guides.rubyonrails.org • http://api.rubyonrails.org • https://codeclimate.com • http://localhost:3000 • https://github.com • http://ruby.railstutorial.org/book/ruby-on-rails-tutorial? version=4.0 • http://ruby-doc.com/docs/ProgrammingRuby/ • …