SlideShare a Scribd company logo
Large Scale Ruby Project, Challenges
                  and Pitfalls




●   Karunakar Revuri
●   Castle Rock Research
●   Rails Contributor
●   @karuna_revuri
●   https://github.com/Karunakar
Ruby Project


● Code
● Tests
● Performance
Test Driven Development
Good


● My_code has_many units and functionals
● Thoughtbot-shoulda
Bad

● Test suite is taking more than 45 mins
Why?


● Many tests
● Bad Tests
● Unnecessary objects
● Unnecessary tests
● Tests with assert true
● Tests with !assert failure
● Big tests
● Random failure tests
Solution


● Cleanup
● Mock your objects when needed
● Run tests in parallel
DEMO
Behavior Driven Development


FRAMEWORK
● Cucumber-capybara

GOOD
MyCode has many scenarios

BAD
● Cucumber is slow because of selenium
Selenium


● Running selenium with cucumber can eat up lot of time.
● Build time reached more than 3 hours
Solutions


●   @rack_test

●   Parallel processes
BORG


A Distributed Test Suite Runner for Rails
-- Hemant Kumar and Karunakar




● Eventmachine is fast, simple eventmachine processing lib
● Redis is advanced key value storage
How BORG works?


                               Developer
                               Machine-1

          Borg Server


                               Developer
                               Machine-2
 Cruise
Machine


                              Developer
            Redis             Machine-3
            Server
BORG Supports


● Shoulda on MRI with rails
● Cucumber on MRI with rails
● Rake::Test on MRI with rails
● Rspec on MRI with rails


Works with 1.8.7 and 1.9.1, 1.9.2 with rails2x and 3x
https://github.com/Karunakar/borg
https://github.com/gnufied/borg
GOOD and BAD


GOOD
● Fast build
● Devs spend less time waiting to checkin


BAD
● Developer machines
● Test Splitting
Code Coverage Tools


● Simple Cov 1.9
● Rcov 1.8
Continuous Integration


● Continuous processes of applying quality
● Reduce the time to deliver
● Build
Continuous Integration


● Continuous processes of applying quality
● Reduce the time to deliver
● Build
Rubyconf presentation
Code Quality


● Pair programming
● Code review
Pairing Environment
Advantages


● Code is clean
● Bugs are less
● More than one will be familiar with code
● Sharing the knowledge is easy
● Good Learning curve
● Maintaining the code quality
Disadvantages


● Active vs Passive
● Communication between the pairs
Solutions
 Switch the pairs frequently
Code Reviews


● Code review helps spread information about a project
   between team members
● Allows people to suggest ideas and help clarify code
● Its a good time to implement some small refactoring, as
   soon as problems are found
● Works best with small groups
Statistical Code Analysis


Statistics of code without actually executing code
rake stats
Code Smell using REEK


● Duplicate Code
● Long Method
● Large Class
● Simulated Polymorphism
Performance Improvements


● Internal quality
● External quality (External quality is end user happiness)
Performance Tools


● Bullet
● Rails indexes
● NewRelic
● Oink
Demo on Bullet
Rails Indexes Demo
Oink


● Memory usage in rails applications
● Memory and active record instantiation information
Oink


2012-03-25T03:45:15+00:00 app[web.2]: Oink Action:
sessions#new
2012-03-25T03:45:15+00:00 app[web.2]: Memory usage:
500408 | PID: 3
2012-03-25T03:45:15+00:00 app[web.2]: Instantiation
Breakdown: Total: 13 | RegionalOption: 8 | Region: 3 |
Country: 2
New Relic


● Performance management tool
● Slow web transactions
● Database hits and queries
● Slow web pages
● What are the reasons
Optimization


● Find with select
● Eager loading
● Use active-reload in development
● Use ActiveRecord to_xml instead of the xml_bulders
● Validations when needed
● Use memcache
● Use query-analyzer in development
Optimization




● Iterators
● Explain command
● Error notifier
Client Side


● Asset pipelining
● Load the js at the end of the file
● Valid HTML / XHTML
Thanks
Questions

More Related Content

What's hot (20)

PPTX
It's a Breeze to develop Airflow (Cloud Native Warsaw)
Jarek Potiuk
 
PDF
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
Samsul Ma'arif
 
PDF
Introduction to K6
Knoldus Inc.
 
PPTX
How to deploy your Apps in serverless-way using App Engine.pptx
Institut Teknologi Sepuluh Nopember Surabaya
 
PPTX
The Road to Kubernetes
Deniz Zoeteman
 
PDF
Cassovary
vinodkumarlogan
 
PDF
Continuous Development Pipeline
Izzet Mustafaiev
 
ODP
Akka Persistence
Knoldus Inc.
 
PDF
2021 JCconf TW Going Reactive with Quarkus Kotlin & Arrow-KT
Hung-Ming Chang
 
PDF
Agile Apps with App Engine
Calvin Cheng
 
PPTX
MyHeritage - QA Automations in a Continuous Deployment environment
MatanGoren
 
PDF
Continuous Delivery at Snyk
Anton Drukh
 
PPTX
Rethinking React
GlobalLogic Ukraine
 
PPTX
Fast Deployments to Multiple Golang Lambda Functions
Kp Krishnamoorthy
 
KEY
Semi Automatic Code Review
Richard Huang
 
PPTX
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...
OutSystems
 
PPTX
Cucumber Tool
Sohail Ahmed
 
PDF
Angular Libraries & NPM
Knoldus Inc.
 
PPTX
Jenkins pipeline as code
Mohammad Imran Ansari
 
PPTX
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Борис Зора
 
It's a Breeze to develop Airflow (Cloud Native Warsaw)
Jarek Potiuk
 
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
Samsul Ma'arif
 
Introduction to K6
Knoldus Inc.
 
How to deploy your Apps in serverless-way using App Engine.pptx
Institut Teknologi Sepuluh Nopember Surabaya
 
The Road to Kubernetes
Deniz Zoeteman
 
Cassovary
vinodkumarlogan
 
Continuous Development Pipeline
Izzet Mustafaiev
 
Akka Persistence
Knoldus Inc.
 
2021 JCconf TW Going Reactive with Quarkus Kotlin & Arrow-KT
Hung-Ming Chang
 
Agile Apps with App Engine
Calvin Cheng
 
MyHeritage - QA Automations in a Continuous Deployment environment
MatanGoren
 
Continuous Delivery at Snyk
Anton Drukh
 
Rethinking React
GlobalLogic Ukraine
 
Fast Deployments to Multiple Golang Lambda Functions
Kp Krishnamoorthy
 
Semi Automatic Code Review
Richard Huang
 
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...
OutSystems
 
Cucumber Tool
Sohail Ahmed
 
Angular Libraries & NPM
Knoldus Inc.
 
Jenkins pipeline as code
Mohammad Imran Ansari
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Борис Зора
 

Similar to Rubyconf presentation (20)

PDF
Microservices at Mercari
Google Cloud Platform - Japan
 
PDF
Go at Skroutz
AgisAnastasopoulos
 
PPTX
21o. RubyFloripa - Maintaining legacy Rails app and introducing Elixir
Weverton Timoteo
 
ODP
Test Automation Framework using Cucumber BDD overview (part 1)
Mindfire Solutions
 
PPTX
Modern Web-site Development Pipeline
GlobalLogic Ukraine
 
PDF
Overcome a Frontier
Izzet Mustafaiev
 
PDF
The benefits of running Spark on your own Docker
Itai Yaffe
 
PDF
Requirements the Last Bottleneck
Karwin Software Solutions LLC
 
PDF
Code review and automated testing for Puppet code
wzzrd
 
PDF
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Martin Spier
 
PDF
DevOps for TYPO3 Teams and Projects
Fedir RYKHTIK
 
PDF
Docker. Does it matter for Java developer ?
Izzet Mustafaiev
 
PDF
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
PPTX
Rails automatic test driven development
tyler4long
 
PPTX
Lean-Agile Development with SharePoint - Bill Ayers
SPC Adriatics
 
PDF
Lessons learned from operating small scale clusters.pdf
decsoham
 
PDF
Lessons learned from operating small scale clusters.pdf
decsoham
 
KEY
improving the performance of Rails web Applications
John McCaffrey
 
PDF
Expedia 3x3 presentation
Drew Hannay
 
PDF
From Rails legacy to DDD - Pivorak, Lviv
Andrzej Krzywda
 
Microservices at Mercari
Google Cloud Platform - Japan
 
Go at Skroutz
AgisAnastasopoulos
 
21o. RubyFloripa - Maintaining legacy Rails app and introducing Elixir
Weverton Timoteo
 
Test Automation Framework using Cucumber BDD overview (part 1)
Mindfire Solutions
 
Modern Web-site Development Pipeline
GlobalLogic Ukraine
 
Overcome a Frontier
Izzet Mustafaiev
 
The benefits of running Spark on your own Docker
Itai Yaffe
 
Requirements the Last Bottleneck
Karwin Software Solutions LLC
 
Code review and automated testing for Puppet code
wzzrd
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Martin Spier
 
DevOps for TYPO3 Teams and Projects
Fedir RYKHTIK
 
Docker. Does it matter for Java developer ?
Izzet Mustafaiev
 
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
Rails automatic test driven development
tyler4long
 
Lean-Agile Development with SharePoint - Bill Ayers
SPC Adriatics
 
Lessons learned from operating small scale clusters.pdf
decsoham
 
Lessons learned from operating small scale clusters.pdf
decsoham
 
improving the performance of Rails web Applications
John McCaffrey
 
Expedia 3x3 presentation
Drew Hannay
 
From Rails legacy to DDD - Pivorak, Lviv
Andrzej Krzywda
 
Ad

Recently uploaded (20)

PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Ad

Rubyconf presentation