I recently come across some surprising code involving exceptions which prompted me to look a bit deeper into exceptions in Ruby. In this post, I would like to share some of what I found.
This is where it all started. I had a script that did something like the following (it was not quite this simple, but it shows the important parts):
Recently, a new client approached us with a performance problem on their existing Ruby on Rails application; they were experiencing massive growth with over 50,000 new users per day signing up, and their app was receiving over 400 requests per second (and growing).
The rapidly increasing load was leading to big problems, with their existing Rails application experiencing frequent outages and causing sleepless nights for their team. They asked reinteractive to investigate and find out how we could get the app stable as fast as possible.
If you are familiar with Rails, you know that it has a predefined directory structure. Rails was one of the early adaptors of the MVC (Model, View, Controller) pattern. In fact that is one of the key strengths of the framework; it is easy to learn since everything has its own place. This is all well and good if your Rails app is relatively a small one - but when your app starts growing with features and functionality, soon you will find some code snippets that don’t seem to fit into the standard Rails directory structure. This is when these methods tend to get pushed to the ActiveRecord models. However, not all of these methods directly relate to a model; often these methods contain some validations required by the business/client.
In such scenarios, implementing the logic via service objects or services would be a good idea. Simply put, a “service object” is a Ruby class that contains some of the application's business logic without pushing it to the ActiveRecord layer. Often, a Service is a PORO (Plain Old Ruby Object).
RUBYGEMS_GEMDEPS is a 'new' environment variable for RubyGems(>=2.2.0). With this line of code in your
You don't need to type
bundle exec anymore.
reinteractive is Australia’s largest dedicated Ruby on Rails development company. We don’t cut corners and we know what we are doing.
We are an organisation made up of amazing individuals and we take pride in our team. We are 100% remote work enabling us to choose the best talent no matter which part of the country they live in. reinteractive is dedicated to making it a great place for any developer to work.
- AppWorkshop - Consultation & Project Scoping
- App Design Workshop
- User Experience (UX) Design
- Visual Design
- Web & Mobile App Development
- Salesforce & Heroku Custom Solutions
- OpsCare® Managed Hosting
- CodeCare® Code Maintenance
- Code Inspect Service
- Ruby on Rails Upgrade Support
AppWorkshop - Consultation & Project Scoping
We work hard to find the right digital solution for you. Through our AppWorkshop we work with you to identify opportunities and engage in expert planning for business-critical applications. The aim is to get your application delivered and operating as fast as possible, with the viewpoint of incrementally adding features as the site matures and grows.
App Design Workshop
Developing any software is a significant investment. If the foundations aren’t there before you begin development you can invest more than necessary getting your MVP to market. This workshop is for anyone who needs to innovate their business and requires the ideation of an application or anyone who has an application idea that needs to be mapped out.
User Experience (UX) Design
We help make even the most complicated web and mobile apps easy to navigate and create solutions that engage users, keeping them happy and on your page longer.
Our Visual Designers work with you to create the final look and feel of your website or application, including the strategic implementation of images, colours, fonts and other elements.
Web & Mobile App Development
Salesforce & Heroku Custom Solutions
We have in-depth experience in utilising the Salesforce® API and the Heroku platform that allows us to build custom applications that sync with Salesforce, allowing you to leverage the full power of the Salesforce Cloud.
OpsCare® Managed Hosting
We will protect, monitor and scale your Ruby on Rails website or app 24/7. Hosted on AWS or Heroku. We wear the pagers, so you can concentrate on growing your business.
CodeCare® Code Maintenance
Fixed price ongoing code maintenance for Ruby on Rails applications to handle future updates and tweaks.
An application review is where reinteractive reviews your application code base for security flaws, performance issues, or anything that should be improved.
Code Inspect Service
With over 200 major projects completed by reinteractive, we have a very deep understanding of best practices and ideal scenes in software development, positioning us to deliver a comprehensive report on the quality of any Ruby on Rails based code.
Ruby on Rails Upgrade Support
Our expert team have intimate knowledge of the Ruby on Rails framework, making reinteractive a fantastic choice for upgrading your application to the latest version of Rails and Ruby.