Microservices Resource Guide

Martin Fowler’s guide to microservices is a collection of recommended articles, presentations, and materials regarding the subject.

Practical Persistence in Go: Organising Database Access

In this post the author takes a look at four different methods for organizing your code and structuring access to your database connection pool.

Getting Started with Rails 5's ActionCable and Websockets

An introduction to Rails 5’s new feature, ActionCable.

A Neural Network in 11 lines of Python

A bare bones neural network implementation to describe the inner workings of backpropagation.

Stack Overflow: Replacing a 32-bit Loop Count Variable with 64-bit Introduces Crazy Performance Deviations

Very interesting low level discussion about optimization and how empirical optimization can also be misleading.

Inceptionism: Going Deeper into Neural Networks

Very cool technique to peek inside a complex neural network built to interpret images.

Regexes: The Bad, the Better, and the Best

A story about how just a few characters can make such a big difference in performance

First Aid Git

FAQ and solutions for the most common git issues.

Cleaning Up Git Branches

The article shows how to clean up unused branches from your git repository.

What is Branch Prediction?

Interesting discussion and answer about branch prediction, which is a interesting subject on it’s own.

Checking for N+1 queries isn't necessarily intuitive. Here's one simple way to verify you have eliminated these pesky queries.

This article isn't meant to review all the nuances of includes, joins, or N+1s but to highlight a technique to check a given query.

Take the following scope:

scope :for_auto_suggest, -> {
  includes(:user_verification, :profile_photo_files, { account: [:roles, :career_preference] }, { user_professional_detail: [:specialty] }, { user_practice_contact: [:country] })

Because ActiveRecord lazily evaluates queries, running the following on console doesn't necessarily highlight the N+1 problem:


However, you can force it to show you the N+1 by requesting the joined attribute you're after:


At this point you'll see something that looks suspicious:

City Load (0.4ms)  SELECT  `cities`.* FROM `cities`  WHERE `cities`.`id` = 127817 LIMIT 1
  app/models/user.rb:449:in `city_name'
  bin/rails:8:in `<top (required)>'
City Load (0.3ms)  SELECT  `cities`.* FROM `cities`  WHERE `cities`.`id` = 102319 LIMIT 1
  app/models/user.rb:449:in `city_name'
  bin/rails:8:in `<top (required)>'
City Load (0.2ms)  SELECT  `cities`.* FROM `cities`  WHERE `cities`.`id` = 127561 LIMIT 1
  app/models/user.rb:449:in `city_name'
  bin/rails:8:in `<top (required)>'

By modifying your scope to include the associated model :city in the correct nested association...:

{ user_practice_contact: [:country, :city ] }

...you can re-run the same scope and the log will look more like this:

City Load (0.3ms)  SELECT `cities`.* FROM `cities`  WHERE `cities`.`id` IN (127817, 102319, 127561)
  bin/rails:8:in `<top (required)>'

This is exactly what you want to see.

When should you use DateTime and when should you use Time?

Interesting write-up and explanation about the difference of DateTime and Time objects.

Inside NGINX: How We Designed for Performance & Scale

NGINX leads the pack in web performance, and it’s all due to the software's design. Whereas many web servers and application servers use a simple threaded or process-based architecture, NGINX stands out with a sophisticated event-driven architecture that enables it to scale to hundreds of thousands of concurrent connections on modern hardware.

Practical Cryptography With Go

This book explaining cryptography in Go is a good resource for both learning about cryptography and Go.

The Brunch.io Guide

This is an attempt at a comprehensive guide to Brunch, an excellent builder for browser apps that gives Grunt, Gulp, Broccoli, et al. a run for their money.

How to Undo (Almost) Anything with Git

Tips & tricks explaining how to properly undo commits on Git.

Libraries & Tools


A tool to detect bugs in Android and iOS apps before they ship.

Critical Vulnerabilities in JSON Web Token Libraries

This post describes a vulnerability with JSON Web Tokens (JWT). It's an interesting read and has good to know vulnerability.

Testing Strategies in a Microservice Architecture

A series of slides about Microservice testing strategies.

WebSockets From Scratch

How to implement a WebSocket server from scratch in Ruby. It’s a good way to learn the protocol.

How to learn C: An introduction for the high-level programmer

Learning C (and lower-level languages) can help develop an understanding of what happens behind the scene.