SlideShare a Scribd company logo
Ruby on Rails
From simplicity to complexity
07/03/2014 - Presentation for le Wagon
Ruby on Rails
From simplicity to complexity
Going to production
Scaling
Bootstrapping
If we were to start over with Copass,
what are the good choices we’d keep and the lessons we’d learn?
Bootstrapping
Bootstrapping
★ Database: PostgreSQL
★ Front-End: Bootstrap, jQuery
★ Precompiled languages: Haml,
Coffeescript, SASS, Markdown
★ Debugging: Better Errors
★ Authentication: Devise
★ Version Control: Git, Github (of course)
★ Support: Stackoverflow (of course)
★ REST structure
★ MVC structure
★ Ruby tricks
★ Don’t use DB-related gems
★ Multi-steps signup
★ Avoid front-end gems
★ Name things
LESSONS LEARNEDGOOD CHOICES
Markdown http://en.wikipedia.org/wiki/Markdown
❖ Markdown allows you to write using an easy-to-read, easy-to-write
plain text format, then convert it to structurally valid XHTML (or HTML).
❖ Allows to separate
content from logic !
Anyone can edit
markdown documents
❖ Used by Github,
Stackoverflow etc.
Markdown 3 steps
Better Errors gem https://github.com/charliesome/better_errors
❖ Best tool for debugging
❖ Displays a live console in your browser
❖ Allows you to:
+ see the content of variables
+ see the source code where
the bug occured
+ includes gem related code
Better error interface
REST Structure http://en.wikipedia.org/wiki/Representational_state_transfer
❖ Heard of those GET, POST, PUT, DELETE http methods?
❖ Respect the basics:
➢ GET : fetches one/many objects, doesn’t change any value (read only)
➢ POST : creates an object
➢ PUT : edit an object
➢ DELETE : delete an object
❖ Advantages:
➢ Use the convention among the team
➢ Keeps you router clean
➢ Prevents pages refresh from doing several tie the same action
➢ Good API design
Don’t use DB related gem
❖ We all use many gems to bootstrap faster
❖ Don’t use them when they are database related
❖ Eg. Friendships managed with Amistad
➢ Cool, I have a whole set of methods ready (add friend, remove friend, get
friends, get pending requests etc.)
➢ But I need to add a notification level on each friend
➢ And also some friend suggestions
➢ Errr…. you can’t because it is a gem
➢ Hence double data size, harder management etc.
If you really want this gem,
you can either copy paste
its code into your project,
or fork it straight away and
customize it as you need as
if it were your proper code!
Going to production
LESSONS LEARNED
Going to production
★ Hosting: Heroku + S3
★ Backups: PGBackups Archive
★ Deployment: Deploy Hooks
★ Spam prevention: Negative
Captcha
★ Maintenance: Exception
Notification, Dead Man Snitch
★ Use Paperclip as a service
★ Testing becomes necessary at
this step
GOOD CHOICES
Negative Captcha https://github.com/subwindow/negative-captcha
❖ In production, every public form is subject to spam
❖ But Captchas are boring, time consuming, as a user, you’d feel
frustrated, untrusted
❖ Someone invented negative captcha:
❖ Add a fake field that will be filled by robots
but not humans
❖ User experience is the same !
Name
Email
Form
Hidden fieldOk
Filled by Robots not
humans
Scaling
LESSONS LEARNED
Scaling
★ Web server: Phusion Passenger
★ CDN: Cloudfront
★ Background jobs: Delayed Job +
Workless
★ Database Indexes
★ Memory usage
★ To test: Dynosaur
GOOD CHOICES
Workless https://github.com/lostboy/workless
❖ Based on delayed jobs : sends tasks to the background by adding .
delay
➢ Eg.
❖ But for background jobs, you need a Heroku worker which costs
money
❖ The awesomeness of workless is that the worker is automatically
scaled up when there are tasks in the queue, and down when it is over
➢ No extra fees!
def generate_sizes_async(erase= false)
self.delay.generate_sizes(erase)
end
Next steps
❖ More front end logic
➢ Angular
❖ Going Mobile, how?
➢ Ruby Motion ( ), Responsive web design, native app with strong
API
Going mobile
Tips and reads
❖ Subscribe to RubyWeekly newsletter
❖ Very good articles:
➔ How to get More Bang for your Heroku Buck While Making Your Rails Site Super Snappy
➔ An Introduction To DOM Events
➔ A basic guide to when and how to deploy HTTPS
➔ What every web developer must know about URL encoding
➔ Ruby Styleguide
➔ Github flow
?
Thanks !
Augustin Riedinger
augustin@copass.org
http://copass.org

More Related Content

What's hot (20)

PDF
Build the mobile web you want
k88hudson
 
PPT
Web performance: crafts of internet age
Huangmao(Homer) Quan
 
PDF
The ES6 Conundrum - All Things Open 2015
Christian Heilmann
 
PDF
Web Assembly (W3C TPAC presentation)
Kenneth Rohde Christiansen
 
PDF
Ruby course-1-practice
Burhanudin Hakim
 
PPTX
Javascript Frameworks Comparison
Deepu S Nath
 
PDF
Modern frontend workflow
Revath S Kumar
 
PPTX
Life in the Fast Lane: Speed, Usability & Search Engine Optimization
Dana DiTomaso
 
PDF
Intro to react_v2
Feather Knee
 
PPTX
Web assembly - Future of the Web
CodeValue
 
PPTX
Angular – Say Goodbye to Javascript Soup
Graeme Foster
 
PDF
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...
Ezra Gildesgame
 
PPTX
Welcome to level 2 partial
Edwin Loján
 
PDF
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
Jonathan Perlman
 
PDF
WordCamp 2012 - WordPress Webapps
tjasko
 
PDF
All the small things… - Awwwards 2016
Christian Heilmann
 
PPTX
Ember
Domenic Simone
 
PDF
WebAssembly Overview
Alexandr Skachkov
 
PPTX
Welcome to level 22038
Edwin Loján
 
PDF
Web dev syllabus
Adithcheshan
 
Build the mobile web you want
k88hudson
 
Web performance: crafts of internet age
Huangmao(Homer) Quan
 
The ES6 Conundrum - All Things Open 2015
Christian Heilmann
 
Web Assembly (W3C TPAC presentation)
Kenneth Rohde Christiansen
 
Ruby course-1-practice
Burhanudin Hakim
 
Javascript Frameworks Comparison
Deepu S Nath
 
Modern frontend workflow
Revath S Kumar
 
Life in the Fast Lane: Speed, Usability & Search Engine Optimization
Dana DiTomaso
 
Intro to react_v2
Feather Knee
 
Web assembly - Future of the Web
CodeValue
 
Angular – Say Goodbye to Javascript Soup
Graeme Foster
 
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...
Ezra Gildesgame
 
Welcome to level 2 partial
Edwin Loján
 
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
Jonathan Perlman
 
WordCamp 2012 - WordPress Webapps
tjasko
 
All the small things… - Awwwards 2016
Christian Heilmann
 
WebAssembly Overview
Alexandr Skachkov
 
Welcome to level 22038
Edwin Loján
 
Web dev syllabus
Adithcheshan
 

Similar to Copass + Ruby on Rails = <3 - From Simplicity to Complexity (20)

PDF
Basic Rails Training
Arthit Hongchintakul
 
PPTX
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
PDF
Web Development using Ruby on Rails
Avi Kedar
 
PDF
Lessons Learnt in 2009
pratiknaik
 
KEY
Ruby on Rails survival guide of an aged Java developer
gicappa
 
PDF
Panmind at Ruby Social Club Milano
Panmind
 
PPTX
SELF - Becoming a Rails Developer - The Rest of the Story
Nathanial McConnell
 
PDF
Rails - getting started
True North
 
PDF
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
peter_marklund
 
PPT
Rails 101
The Active Network
 
PDF
Rails 3 : Cool New Things
Y. Thong Kuah
 
PDF
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
PPTX
Learning Web Development with Ruby on Rails Launch
Thiam Hock Ng
 
PDF
RubyEnRails2007 - Dr Nic Williams - Keynote
Dr Nic Williams
 
PDF
Agile Web Development With Rails 4th Edition 4th Edition Sam Ruby
waumapis
 
PDF
Hands on Ruby on Rails
Salesforce Developers
 
PDF
Migrating Legacy Rails Apps to Rails 3
Clinton Dreisbach
 
PPTX
Day 1 - Intro to Ruby
Barry Jones
 
PPTX
Idea2app
Flumes
 
KEY
Why ruby and rails
Reuven Lerner
 
Basic Rails Training
Arthit Hongchintakul
 
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Web Development using Ruby on Rails
Avi Kedar
 
Lessons Learnt in 2009
pratiknaik
 
Ruby on Rails survival guide of an aged Java developer
gicappa
 
Panmind at Ruby Social Club Milano
Panmind
 
SELF - Becoming a Rails Developer - The Rest of the Story
Nathanial McConnell
 
Rails - getting started
True North
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
peter_marklund
 
Rails 3 : Cool New Things
Y. Thong Kuah
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
Learning Web Development with Ruby on Rails Launch
Thiam Hock Ng
 
RubyEnRails2007 - Dr Nic Williams - Keynote
Dr Nic Williams
 
Agile Web Development With Rails 4th Edition 4th Edition Sam Ruby
waumapis
 
Hands on Ruby on Rails
Salesforce Developers
 
Migrating Legacy Rails Apps to Rails 3
Clinton Dreisbach
 
Day 1 - Intro to Ruby
Barry Jones
 
Idea2app
Flumes
 
Why ruby and rails
Reuven Lerner
 
Ad

Recently uploaded (20)

PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
Français Patch Tuesday - Juillet
Ivanti
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
Français Patch Tuesday - Juillet
Ivanti
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Ad

Copass + Ruby on Rails = <3 - From Simplicity to Complexity

  • 1. Ruby on Rails From simplicity to complexity 07/03/2014 - Presentation for le Wagon
  • 2. Ruby on Rails From simplicity to complexity Going to production Scaling Bootstrapping If we were to start over with Copass, what are the good choices we’d keep and the lessons we’d learn?
  • 4. Bootstrapping ★ Database: PostgreSQL ★ Front-End: Bootstrap, jQuery ★ Precompiled languages: Haml, Coffeescript, SASS, Markdown ★ Debugging: Better Errors ★ Authentication: Devise ★ Version Control: Git, Github (of course) ★ Support: Stackoverflow (of course) ★ REST structure ★ MVC structure ★ Ruby tricks ★ Don’t use DB-related gems ★ Multi-steps signup ★ Avoid front-end gems ★ Name things LESSONS LEARNEDGOOD CHOICES
  • 5. Markdown http://en.wikipedia.org/wiki/Markdown ❖ Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML). ❖ Allows to separate content from logic ! Anyone can edit markdown documents ❖ Used by Github, Stackoverflow etc. Markdown 3 steps
  • 6. Better Errors gem https://github.com/charliesome/better_errors ❖ Best tool for debugging ❖ Displays a live console in your browser ❖ Allows you to: + see the content of variables + see the source code where the bug occured + includes gem related code Better error interface
  • 7. REST Structure http://en.wikipedia.org/wiki/Representational_state_transfer ❖ Heard of those GET, POST, PUT, DELETE http methods? ❖ Respect the basics: ➢ GET : fetches one/many objects, doesn’t change any value (read only) ➢ POST : creates an object ➢ PUT : edit an object ➢ DELETE : delete an object ❖ Advantages: ➢ Use the convention among the team ➢ Keeps you router clean ➢ Prevents pages refresh from doing several tie the same action ➢ Good API design
  • 8. Don’t use DB related gem ❖ We all use many gems to bootstrap faster ❖ Don’t use them when they are database related ❖ Eg. Friendships managed with Amistad ➢ Cool, I have a whole set of methods ready (add friend, remove friend, get friends, get pending requests etc.) ➢ But I need to add a notification level on each friend ➢ And also some friend suggestions ➢ Errr…. you can’t because it is a gem ➢ Hence double data size, harder management etc. If you really want this gem, you can either copy paste its code into your project, or fork it straight away and customize it as you need as if it were your proper code!
  • 10. LESSONS LEARNED Going to production ★ Hosting: Heroku + S3 ★ Backups: PGBackups Archive ★ Deployment: Deploy Hooks ★ Spam prevention: Negative Captcha ★ Maintenance: Exception Notification, Dead Man Snitch ★ Use Paperclip as a service ★ Testing becomes necessary at this step GOOD CHOICES
  • 11. Negative Captcha https://github.com/subwindow/negative-captcha ❖ In production, every public form is subject to spam ❖ But Captchas are boring, time consuming, as a user, you’d feel frustrated, untrusted ❖ Someone invented negative captcha: ❖ Add a fake field that will be filled by robots but not humans ❖ User experience is the same ! Name Email Form Hidden fieldOk Filled by Robots not humans
  • 13. LESSONS LEARNED Scaling ★ Web server: Phusion Passenger ★ CDN: Cloudfront ★ Background jobs: Delayed Job + Workless ★ Database Indexes ★ Memory usage ★ To test: Dynosaur GOOD CHOICES
  • 14. Workless https://github.com/lostboy/workless ❖ Based on delayed jobs : sends tasks to the background by adding . delay ➢ Eg. ❖ But for background jobs, you need a Heroku worker which costs money ❖ The awesomeness of workless is that the worker is automatically scaled up when there are tasks in the queue, and down when it is over ➢ No extra fees! def generate_sizes_async(erase= false) self.delay.generate_sizes(erase) end
  • 15. Next steps ❖ More front end logic ➢ Angular ❖ Going Mobile, how? ➢ Ruby Motion ( ), Responsive web design, native app with strong API Going mobile
  • 16. Tips and reads ❖ Subscribe to RubyWeekly newsletter ❖ Very good articles: ➔ How to get More Bang for your Heroku Buck While Making Your Rails Site Super Snappy ➔ An Introduction To DOM Events ➔ A basic guide to when and how to deploy HTTPS ➔ What every web developer must know about URL encoding ➔ Ruby Styleguide ➔ Github flow