Operations | Monitoring | ITSM | DevOps | Cloud

Ruby

Rails is Fast: Optimize Your View Performance

In this post, we’ll look into tried and true methods of improving Rails view performance. Specifically, I will focus on database efficiency, view manipulation, and caching. I think the phrase “premature optimization is the root of all evil” has been taken a little out of context. I’ve often heard developers use this during code reviews when simple optimization techniques are pointed out.

Pros and Cons of Using structure.sql in Your Ruby on Rails Application

In today’s post, we’ll cover the significant differences and benefits of using structure.sql versus the default schema.rb schema formats in your Ruby on Rails application. In a data-driven world, knowing how to exploit all of your database’s rich features can make the difference between a successful and unsuccessful enterprise.

Configurable Ruby Modules: The Module Builder Pattern

In this post, we’ll explore how to create Ruby modules that are configurable by users of our code — a pattern that allows gem authors to add more flexibility to their libraries. Most Ruby developers are familiar with using modules to share behavior. After all, this is one of their main use cases, according to the documentation.

Exception Handling in Ruby

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. If not accounted for, these can affect user experience and can even manifest as security loopholes, enabling attackers to compromise the system.

Introducing AutoInstruments: zero-effort performance monitoring of custom Ruby code

Instrumenting the performance of custom code (the code you write, not the libraries you require) in web apps has been a thorn in my side for years. Yes, we have a custom instrumentation API, but raise your hand if you enjoy sprinkling your code with this? Anyone? Having a custom code instrumentation blackhole doesn't matter if your app spends almost all of its time in common libraries that Scout instruments by default (ex: ActiveRecord, Redis, View Rendering, and HTTP calls).

Birds of a Fiber: A look at Falcon, a modern asynchronous web server for Ruby

The GitHub Readme describes Falcon as, "... *a multi-process, multi-fiber rack-compatible HTTP server ... Each request is executed within a lightweight fiber and can block on up-stream requests without stalling the entire server process."* The gist: Falcon aims to increase throughput of web applications by using Ruby’s Fibers to be able to continue serving requests while other requests are waiting on IO (ActiveRecord queries, network requests, file read/write, etc).