Faster Rails: Eliminating N+1 queries

This article is part of our Faster Rails series. Check out the previous article about index creation on large tables.

Rails does not scale well – this argument is often used to downplay the worth of the language and the framework. Yet, many businesses from small startups to platforms with millions of users use it as the backbone of their operations. A good question to ask ourselves is whether Rails simply can't scale, or if the issue is hidden somewhere deeper.

Read more...

Tips on Treating Flakiness in your Rails Test Suite

To say that flaky tests are annoying is to put it mildly. They can decimate both a developer's time and productivity, are notoriously difficult to deal with, and are unfortunately a reality of software development.

Our collegues have written more general posts in the past about dealing with flaky tests and why it is important. I would encourage you to read them. On the other hand, I will be focusing on sharing the experience I have gathered after about a year of dealing with flaky tests while working on a Rails application.

Read more...

Visualizing continuous integration, continuous delivery, and continuous deployment View diagram in full screen

Continuous integration, continuous deployment, and continuous delivery are like vectors that have the same direction, but different magnitude. Their goal is the same: make our software development and release process faster and more robust.

The key difference between the three is in the scope of automation applied. What gets people who are new to the field confused is that they are not mutually exclusive, but include each other, like Russian dolls.

Read more...

Faster Rails: Indexing Large Database Tables Without Downtime

This article is part of our Faster Rails series. Check out the previous article about proper database indexing.

As the scope and size of a Rails project grows, actions that were blazingly fast can become slow, and even downright unacceptable. The cause behind this issue can be an exponential growth of your database tables that makes lookups and updates much slower. If this is the case, adding missing indexes to your database is a cheap and easy way to drastically improve the performance of your application.

Read more...

Speeding Up Rendering Rails Pages with render_async

Adding new code to Rails controllers can bring a couple of problems with it. Sometimes controller actions get really big, and they tend to do a lot of things. Another common problem is an increase in data over time, which can lead to slow page loading time. Adding new code to controller actions can also sometimes block the rendering of some actions if it fails, breaking user experience and user hapiness.

Here at Semaphore, we came across these types of problems a couple of times. We usually resolved them by splitting controller actions into smaller actions, and rendering them asynchrounously using plain Javascript.

After some time, we saw that this can be extracted to render_async, a gem that speeds up Rails pages for you - it loads content to your HTML asynchrounously by making an AJAX call to your Rails server.

Read more...

Faster Rails: Is Your Database Properly Indexed?

This article is part of our Faster Rails series. Check out the previous article about fast existence checks.

My Rails app used to be fast and snappy, and everything was working just fine for several months. Then, slowly, as my product grew and users started to flock in, web requests become slow and my database's CPU usage started hitting the roof. I hadn't changed anything, why was my app getting slower?

Is there any cure for the issues I'm having with my application, or is Rails simply not able to scale?

Read more...

1 2 3 4
Newsletter

Occasional lightweight product and blog updates. Unsubscribe at any time.

© 2009-2017 Rendered Text. All rights reserved. Terms of Service, Privacy policy, Security.