Ruby and Rails don’t have a reputation of being memory-friendly. This comes with a trade-off of being a higher level language that tends to be more developer-friendly. For me, it works. I’m content knowing I might have to pay more to scale a large application knowing I can write it in a language I enjoy. Turns out…Ruby’s not the memory hog I’d previously thought. After…
A few articles ago, I wrote about how to monitor Sidekiq retries using AWS Lambda . Retries are often the first indication of an issue if your application does a lot of background work. As Bark continues to grow, we became interested in how the number of jobs enqueued and retrying trended over time. Using AWS Lambda to post this data to CloudWatch, we were able to visualize this data over time.…
Every Sunday Bark sends parents a weekly recap of their children’s activity online. The first iteration was pretty basic, things like “Your children sent X number of messages this past week” and “You have 10 messages to review”. But we wanted to go deeper… Using PhantomJS, we were able to take screenshots of a modified version of the application’s child…
It’s no mystery I’m a Sidekiq fan – my background job processing library of choice for any non-trivial applications. My favorite feature of Sidekiq has to be retries. By default, failed jobs will retry 25 times over the course of 21 days. As a remote company, we use Slack to stay in touch with everyone AND to manage/monitor our infrastructure (hello #chatops). We can deploy from…
I’ve spent the majority of my career working for companies building products I either wasn’t interested in, or wasn’t the target user. They were jobs. In exchange for my 40 hours, they supplied me a paycheck. As a result, I went home at the end of the day and was able to disconnect. Fast forward almost 15 years and I’m on the opposite end of the spectrum – I build a…
Contrary to popular opinion, I’m a fan of Turbolinks . I leave it enabled in all my Rails applications. Most of the negative opinions I hear relate to it “breaking” third-party jQuery plugins. I say “breaking” because it’s not really changing the plugin’s behavior – just requires the plugin to be initialized differently. If you’re upgrading to…
As gem authors, one of the ways we can provide important information to users of our gems is through post-install messages. Let’s explore what they are, how to set them up, what to include and when to use them. What are Post-Install Messages? As Rubyists, we have plenty experiences installing gems. By running gem install rails , we’re asking Rubygems to install the gem named rails on…
In a previous article, I documented the upcoming public API changes slated for Sucker Punch v2 . Because of a poor initial design, these API changes are backwards incompatible . When I published the previous article, Mike Perham rightly pointed out the opportunity to support the previous versions’s API through an opt-in module . I was hesitant to include support for the old syntax by…
Sucker Punch was created because I had a need for background processing without a separate worker . But I also figured others did too, given that adding a worker dyno on Heroku was $35. For hobby apps, this was a significant cost. Having gotten familiar with Celluloid from my work on Sidekiq, I knew Celluloid had all the pieces to puzzle to make this easier. In fact, one of the earliest…
In the recent series on transitioning to microservices, I detailed a path to move a large legacy Rails monolith to a cluster of a dozen microservices. But not everyone starts out with a legacy monolith. In fact, given Rails popularity amongst startups, it’s likely most Rails applications don’t live to see 4+ years in production . So what if we don’t have a huge monolith on our…
This article was originally posted on the PipelineDeals Engineering Blog In the previous article in this series , we introduced a billing service to determine which features an account could access. If you remember, the email service was a “fire and forget” operation and was capable of handling throughput delays given its low value to the core application. This post will explore how we…
This article was originally posted on the PipelineDeals Engineering Blog In the previous article in this series , we moved the responsibility of emails to a separate Rails application. In order to leverage this new service, we created a PORO to encapsulate the specifics of communicating with our new service by taking advantage of Sidekiq’s built-in retry mechanism to protect from…
This article was originally posted on the PipelineDeals Engineering Blog The PipelineDeals web application recently celebrated its ninth birthday. It’s seen its fair share of developers, all of whom had their own idea of “clean code”. As a team, we’d been brainstorming ways to wrangle certain areas of the application. The question we’d frequently ask ourselves was…
A few fellow authors and friends of mine have put together the Ruby Book Bundle including some of the best Ruby/Rails books out there. The bundle went on sale this morning ! It ll only be available for a week , so be sure to pick it up soon if you’re interested. Here’s a quick rundown of the details: Is this bundle right for me? The books in the Ruby Book Bundle span a range from…
It’s impossible to escape Javascript in a Rails application. From a tiny script to a full-on Javascript framework, websites are becoming more and more reliant on Javascript, whether we like it or not. Several articles back, I documented how I handle page-specific Javascript in a Rails application . My solution included a third-party jQuery plugin that did some magic on the $(document).ready…
In light of RailsConf last month, I spent some time thinking about my experience learning Ruby and Rails back in 2009. The conference included quite a few seasoned veterans, but like any popular technology, there was also plenty of people that either just started learning Rails, or are considering doing so in the near future. Turning the clocks back to when you knew much less about something is…
In my last article , I presented some code that wrapped up accessing a customer’s Stripe data and added a caching layer on top. I wanted to take some time to dig in to that code and see how we can make it better. Decorators give us a tool to add additional functionality to a class while still keeping the public API consistent. From the perspective of the client, this is a win-win! Not only…
With so many services available these days, it’s almost impossible to find or build an application that doesn’t rely on a third-party service. Most developers that have dealt with billing systems within the past few years have likely heard of Stripe . Stripe is, by far, the most developer-friendly billing service I’ve implemented. While Stripe does provide a number of features…
It’s no mystery that I’ve grown to love Rails fixtures . And I tend to mostly use relational databases in my applications, specifically PostgreSQL . Most applications have ancillary data that’s required to support the main function of the application — think drop-downs with states for shipping or credit card type. This data is almost always never interesting, but completely necessary for the…
For the past 2 years, I’ve committed myself to specific goals for the year to come. Most people call them New Year’s Resolutions. Heck, I probably even referred to them as “resolutions” too. But the more I thought about it, the more it dawned on me that a “resolution” felt more like a fix for something — something that didn’t go well in the previous year. Think weight loss (everyone makes…