"HowTo" Posts

Elixir Overview and Tutorial (as told in a Wizard fable)

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

Interested in Learning the Elixir language? Join us in this entertaining Elixir tutorial and overview.

Read More →


Making sense of ActiveRecord joins, includes, preload, and eager_load

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

Like a pair of jumper cables, ActiveRecord's joins, includes, preload, and eager_load methods are incredibly useful, but also very dangerous when used incorrectly. Knowing when and where to use each approach - and even when to combine them - can save you considerable trouble as your app grows.

I'll explore the when and where of each method below.

Read More →


Elixir foundations for Ruby Devs: Recursion

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

I can't recall writing a recursive method in Ruby. I think that's because I find recursion more confusing than iteration (ie Array#map). Additionally, recursion isn't efficient in an imperative language like Ruby.

While I find recursive functions a bit difficult to grok in any language, writing a recursive function in Elixir is a good exercise for 3 reasons:

  1. Unlike Ruby, there isn't a performance hit when you use recursion in Elixir.
  2. Exposure to the inner workings of the List type.
  3. Exposure to pattern matching in multiple ways.

I'll start with some background on List and pattern matching, then write a function to sum the contents of a List. Finally, we'll write a recursive map function.

Read More →


3 Git Productivity Hacks

By Mark Bullet_white Posted in HowTo Bullet_white Comments Comments

Most Ruby developers use Git for their version control system of choice. Git is a wonderful tool that can save you countless hours of lost productivity and makes collaborating with others a cinch. Git's distributed nature also allows devs to work anywhere with or without an internet connection without fear of losing work.

With all of the power that Git provides also comes some complexity. Newcomers to Git may find it's syntax somewhat unintuitive and clunky at first. Even Git power users often have to lookup lesser known Git subcommands and options from time to time. Git is similar to a Swiss Army knife in that it contains many useful tools, but can take some time to master or even find a use for them all.

The goal of this post it to describe some lesser known features of Git and how you can leverage these to improve your Git workflow.

Let's get started.

Read More →


Pillars of the Rails Monitoring Stack: 2018 Edition

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

Here's a behind-the-scenes rundown of how we ensure our apps are in peak condition in 2016* 2018.

*Ed. Note- this is largely unchanged from 2016, so I've updated this post with our 2018 stack.

Focus Service Approx. Price
App MonitoringScout$150/mo
Log MonitoringELK Stack$150/mo
Server & Service Monitoring
Custom Metrics
Pingdom Server Monitor$200/mo
Exception MonitoringSentry$30/mo
Scheduled Job MonitoringDeadman's Snitch$15/mo

Stop searching for a single tool

There's no single, do-everything tool that completely monitors a modern-day Rails stack. If there was, it'd be the software equivalent of the Homer Simpson-designed car. There's simply too many specialized things to put into a single monitoring app.

However, there's good news: a number of best-of-breed services play well together to give you great monitoring coverage of your Rails apps and infrastructure.

When picking a monitoring solution, you can typically choose between two options:

  1. Open Source
  2. SaaS

The upsides of open source: free to install and more customizable. The downsides: generally more difficult to use and fairly complex to maintain.

Most of the monitoring services we use are SaaS. We typically only use open source options when the paid, hosted option is significantly cost prohibitive. Monitoring software is complicated and keeping your own stack running can be a time-sink. The last thing we want is unreliable software monitoring our apps.

Read More →


The Curious Case of the StatsD Timer

By Mark Bullet_white Posted in HowTo Bullet_white Comments Comments


Instrumenting our application with StatsD is easy, especially when we just stick to Counters and Gauges. These metrics return just a single value when implemented. When you get to Timers, however, StatsD steps up it's game and returns eight metrics.

So let's explore the curious case of the timing metric. What do all these metrics mean? How can we use this for instrumenting our application?

Read More →


Older posts: 1 2 3 ... 6