‹ Back to Blog

Ruby

5 hard-earned lessons from a decade of Rails performance work

The last 3,650 days of my professional life have been focused on making Rails apps faster. Below are five lessons I've learned the hard way. 1. Facts alone won't convince the business folk to care about performance The typical pitch to prioritize making an app faster & more reliable goes ...

A Tour of 7 Popular Ruby Frameworks in 2021

Ruby may be over 25 years old, but it remains popular in the software community for its focus on programmer happiness. Building software with Ruby often involves leveraging one or more popular frameworks for the purpose of increasing productivity by relying on existing solutions to common problems. Ruby frameworks generally ...

How to Use Lambdas in Ruby

Lambdas are a powerful feature of the Ruby language. They allow you to wrap logic and data into a portable package. In this post, we’ll cover how and when to use lambdas. You’’ll also learn about the difference between lambdas and Procs, and the performance profile of lambda functions. The ...

A Complete Guide to Rails Caching

If you are using Ruby on Rails, caching might be one of the best tools on your belt to build a better application. The idea behind caching in Rails is to serve thousands of concurrent users on a single server with a single database attached. Let’s take a look at some of the benefits caching can provide.

Python Language vs. Ruby Language

In this blog post, we'll be going through two server-side scripting languages; Python and Ruby with focus on comparing the performance and other factors that might help you in deciding which language to pick over the other for your web application.

Exception Handling in Ruby

What is exception handling? Software systems can be quite prone to error conditions. Systems that involve user interaction are more vulnerable to exceptions as they attract errors at multiple fronts. Errors can take many forms - syntactical errors, network errors, form input errors, invalid authentication errors etc. I

Benchmarking Ruby Code

One of the joys of using the Ruby language is the many different ways that you can solve the same problem, it’s a very expressive language with a rich set of libraries. But how do we know which is the best, most efficient, use of the language? When we are talking about algorithms which are critical to the performance of your application, understanding the most efficient approach to take is essential. Perhaps you’ve been using Scout to hunt down issues, and now that you have found an issue, you want to optimize it. Ruby’s Benchmark module provides a very handy way for you to compare and contrast possible optimizations, and when used in conjunction with a good APM solution it will ensure that you have all bases covered. Let’s take a look at how you can get started with it today!

What’s new in Rails 6?

With the official release of Rails 6 just around the corner, we round up all the major new features coming your way. It is an exciting release due to some big features coming upstream from the Basecamp and GitHub projects. Amongst the many minor updates, useful tweaks and bug fixes, Rails 6 will ship with two completely new frameworks: ActionText and ActionMailbox, and two big scalable-by-default features: parallel testing and multiple database support. So set your Gemfile to get Rails 6.0.0.rc1 and let’s get started!

Which Ruby Background Job Framework is Right for You

If you've been around the Ruby/Rails ecosystem for a bit you've likely heard the term 'background job' or 'offline processing'. But what does that actually mean? How do you know which tasks are suitable to be processed 'in the background'? Once you define those tasks, how do pick the right ...

ActiveRecord: biting the hand that feeds you

Richard Schneeman (better known as Schneems) recently wrote about how he reduced his database server load by 80% ...with one simple trick . In the Hacker News discussion that followed, much of the debate was on the merits of using an ORM like ActiveRecord...or not: In every case I can ...

The danger of Rails.env.production?

When I do a code review, one of the scariest things I see is logic like this: if Rails.env.production? do_additional_work end Why? Your beautiful tests and tightly integrated CI system won't execute that code. You won't see that code execute as you refresh your browser in development. From syntax errors ...

Omnibus Tutorial: Package a standalone Ruby gem

A couple of years ago I visited Argentina. I have trouble enough pronouncing my limited English vocabulary and I don't speak Spanish, but after a bit of time, it was pretty easy to order food, buy groceries, and use a taxi. However, occasional hangups that happen during my regular life ...

Deploying a Faktory worker to AWS Fargate

Looking for a fresh, 2018 approach to deploying a Rails app to AWS? We've partnered with DailyDrip on a series of videos to guide you through the process. We're covering how to Dockerize a Rails app, AWS Fargate, logging, monitoring, setting up load balancing, SSL, CDN, and more. In the ...

Tutorial: Distributed Tracing in Ruby with OpenTracing

It's a lot harder connecting the dots of the request lifecycle when the final response is built from a number of separate microservices. However, distributed tracing - which connects a transaction trace across microservices - is getting a lot easier. In this short tutorial, I'll show how to add distributed ...

DevTrace and the Art of Staying the F*** Out of the Way

DevTrace is a performance widget for your Rails applications in development. It sits unobtrusively in the corner of your page, just waiting to drop insight on your application: See stack traces, SQL timings, and more with just a click! This kind of insight is powerful. You can see how your ...

Monitoring Sidekiq Jobs

Teaser for a soon-to-be released capability: Overview metrics for all your background jobs Chart throughput, latency, error rate, and more. Detailed drill-down on slow jobs See what's making the job slow, identify N+1 queries, and more. Tech preview - want in? Background job monitoring currently supports sidekiq, and is tech ...

Java for Rubyists

The Scout Java Application Monitoring Agent is under active development and we have a few spots open in our alpha program. Email support@scoutapp.com for access. For many Rubyists, Ruby is the first language that they learn and perhaps the only programming language that they know. Ruby provides an excellent gateway ...

From Ruby to Go: a rewrite for the future

During a team camp among the lofty peaks of Breckenridge, Colorado, we talked a lot about the future of Scout and monitoring in general. Big mountains and nature have a way of doing that. One thing that was getting our nerd juices flowing: Go . At Monitorima in May, it ...